summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-07-29 18:23:01 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-07-29 18:23:01 -0400
commit53612664740f3a31d93d2059f7d981da3ba565dc (patch)
treeaa64e8dd5a93df17114ac6bb40eb8df394ab16b8 /exec.c
parent590c038630d453b3652b33e54b81fd06ceb0c6d2 (diff)
downloadbfs-53612664740f3a31d93d2059f7d981da3ba565dc.tar.xz
util: Define O_DIRECTORY to 0 if it's not already defined
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index 342775c..1884536 100644
--- a/exec.c
+++ b/exec.c
@@ -306,11 +306,7 @@ static int bfs_exec_openwd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf)
}
if (execbuf->wd_fd < 0) {
- int flags = O_RDONLY | O_CLOEXEC;
-#ifdef O_DIRECTORY
- flags |= O_DIRECTORY;
-#endif
- execbuf->wd_fd = open(execbuf->wd_path, flags);
+ execbuf->wd_fd = open(execbuf->wd_path, O_RDONLY | O_CLOEXEC | O_DIRECTORY);
}
if (execbuf->wd_fd < 0) {