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 /bftw.c | |
parent | 590c038630d453b3652b33e54b81fd06ceb0c6d2 (diff) | |
download | bfs-53612664740f3a31d93d2059f7d981da3ba565dc.tar.xz |
util: Define O_DIRECTORY to 0 if it's not already defined
Diffstat (limited to 'bftw.c')
-rw-r--r-- | bftw.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -349,11 +349,7 @@ static bool bftw_should_retry(struct bftw_cache *cache, const struct bftw_dir *s static int bftw_dir_openat(struct bftw_cache *cache, struct bftw_dir *dir, const struct bftw_dir *base, int at_fd, const char *at_path) { assert(dir->fd < 0); - int flags = O_RDONLY | O_CLOEXEC; -#ifdef O_DIRECTORY - flags |= O_DIRECTORY; -#endif - + int flags = O_RDONLY | O_CLOEXEC | O_DIRECTORY; int fd = openat(at_fd, at_path, flags); if (fd < 0 && bftw_should_retry(cache, base)) { |