summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'bftw.c')
-rw-r--r--bftw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bftw.c b/bftw.c
index c9dd47b..eb4f0c0 100644
--- a/bftw.c
+++ b/bftw.c
@@ -341,7 +341,10 @@ static DIR *dircache_entry_open(struct dircache *cache, struct dircache_entry *e
const char *at_path = path;
struct dircache_entry *base = dircache_entry_base(cache, entry, &at_fd, &at_path);
- int flags = O_RDONLY | O_DIRECTORY | O_CLOEXEC;
+ int flags = O_RDONLY | O_CLOEXEC;
+#ifdef O_DIRECTORY
+ flags |= O_DIRECTORY;
+#endif
int fd = openat(at_fd, at_path, flags);
if (fd < 0 && dircache_should_retry(cache, base)) {