diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-07-29 18:23:01 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-07-29 18:23:01 -0400 |
commit | 53612664740f3a31d93d2059f7d981da3ba565dc (patch) | |
tree | aa64e8dd5a93df17114ac6bb40eb8df394ab16b8 /eval.c | |
parent | 590c038630d453b3652b33e54b81fd06ceb0c6d2 (diff) | |
download | bfs-53612664740f3a31d93d2059f7d981da3ba565dc.tar.xz |
util: Define O_DIRECTORY to 0 if it's not already defined
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -334,11 +334,7 @@ bool eval_empty(const struct expr *expr, struct eval_state *state) { struct BFTW *ftwbuf = state->ftwbuf; if (ftwbuf->typeflag == BFTW_DIR) { - int flags = O_RDONLY | O_CLOEXEC; -#ifdef O_DIRECTORY - flags |= O_DIRECTORY; -#endif - int dfd = openat(ftwbuf->at_fd, ftwbuf->at_path, flags); + int dfd = openat(ftwbuf->at_fd, ftwbuf->at_path, O_RDONLY | O_CLOEXEC | O_DIRECTORY); if (dfd < 0) { eval_error(state); goto done; |