diff --git a/fallocate.c b/fallocate.c index 4e60459..d73c0f9 100644 --- a/fallocate.c +++ b/fallocate.c @@ -39,9 +39,11 @@ int do_fallocate_syscall (const char *path, __u64 bytecount) err = syscall(SYS_fallocate, fd, mode, offset, len); if (err >= 0) { fsync(fd); + close(fd); exit(0); } err = errno; + close(fd); unlink(path); } perror(path);