summaryrefslogtreecommitdiffstats
path: root/test-file-zero-alloc-speed.c
diff options
context:
space:
mode:
Diffstat (limited to 'test-file-zero-alloc-speed.c')
-rw-r--r--test-file-zero-alloc-speed.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test-file-zero-alloc-speed.c b/test-file-zero-alloc-speed.c
index 73a7975..8081c74 100644
--- a/test-file-zero-alloc-speed.c
+++ b/test-file-zero-alloc-speed.c
@@ -99,9 +99,9 @@ int do_mmap(char *name, off_t len)
return -1;
}
/* memset has to have the mmap'ed file backed by something on
- * disk -- bus error otherwise */
- lseek(fd, len - 1, SEEK_SET);
- write(fd, "0", 1);
+ * disk -- bus error otherwise
+ */
+ ftruncate(fd, len);
addr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED) {