diff options
author | Chris Mason <clm@fb.com> | 2017-07-26 17:45:46 -0700 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2017-07-26 17:45:46 -0700 |
commit | 2551ba214eeaf2f5d8953d0f96fd0b0ac8f076ea (patch) | |
tree | 5b8ca3c899dcac39b8e5bacd5cd5055cb23c452e | |
parent | 44a4fb18ef0e173f12969e145bb2fe64e0253f6c (diff) | |
download | simoop-2551ba214eeaf2f5d8953d0f96fd0b0ac8f076ea.tar.gz |
Fix use-after-close on fds
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | simoop.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |