summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mmalloc.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/mmalloc.hpp b/mmalloc.hpp
index a794a34..8e2ac93 100644
--- a/mmalloc.hpp
+++ b/mmalloc.hpp
@@ -10,14 +10,14 @@ void *r;
char tmpName[] = "/mnt/hugetlbfs/mmallocXXXXXX";
int fd = mkstemp(tmpName);
if (fd < 0) goto fail1;
-
if (ftruncate(fd, size) != 0) goto fail2;
+ if (unlink(tmpName) != 0) goto fail2;
r = mmap(NULL,
- size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_POPULATE,
- fd, 0);
+ size,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_POPULATE,
+ fd, 0);
if (r == MAP_FAILED) goto fail2;
return r;
contact: Jan Huwald // Impressum