summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-12-18 12:38:19 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-12-18 13:19:04 -0500
commit4b9592f93a68f88152b390898004e5e54b540cae (patch)
tree18930e6373e5e75aa2999f405971d7a29e4eebc8 /bftw.c
parent2ebbe75a8d272458cd3229b6033b2a5ce19b105b (diff)
downloadbfs-4b9592f93a68f88152b390898004e5e54b540cae.tar.xz
Implement -regex, -iregex, and -regextype/-E
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)) {