summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2017-07-26 17:45:46 -0700
committerChris Mason <clm@fb.com>2017-07-26 17:45:46 -0700
commit2551ba214eeaf2f5d8953d0f96fd0b0ac8f076ea (patch)
tree5b8ca3c899dcac39b8e5bacd5cd5055cb23c452e
parent44a4fb18ef0e173f12969e145bb2fe64e0253f6c (diff)
downloadsimoop-2551ba214eeaf2f5d8953d0f96fd0b0ac8f076ea.tar.gz
Fix use-after-close on fds
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r--simoop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simoop.c b/simoop.c
index dbb7794..c984168 100644
--- a/simoop.c
+++ b/simoop.c
@@ -1326,7 +1326,6 @@ static void write_to_file(char *path, int seq, char *buf)
write_bytes * 4);
XXH32_digest(xxhash_state);
- close(fd);
/* make some dirty inodes */
if (!append_mode) {
@@ -1336,6 +1335,7 @@ static void write_to_file(char *path, int seq, char *buf)
/* delete some files */
ftruncate(fd, 0);
}
+ close(fd);
}
/* make all the worker files under a main path */