diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-04-15 20:10:26 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-04-15 20:10:26 -0400 |
commit | a1f764c5e5041d80300182b41c346d22292068b2 (patch) | |
tree | 05429e250ae0a97156c7a28999cf3a50b0f189ea | |
parent | 78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2 (diff) | |
download | bfs-a1f764c5e5041d80300182b41c346d22292068b2.tar.xz |
exec: close() the working directory even if !ftwbuf
-rw-r--r-- | exec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -247,7 +247,7 @@ static int bfs_exec_closewd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf) int ret = 0; if (execbuf->wd_fd >= 0) { - if (ftwbuf && execbuf->wd_fd != ftwbuf->at_fd) { + if (!ftwbuf || execbuf->wd_fd != ftwbuf->at_fd) { ret = close(execbuf->wd_fd); } execbuf->wd_fd = -1; |