summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index b260ad9..0946dcc 100644
--- a/eval.c
+++ b/eval.c
@@ -488,7 +488,11 @@ bool eval_empty(const struct expr *expr, struct eval_state *state) {
struct BFTW *ftwbuf = state->ftwbuf;
if (ftwbuf->typeflag == BFTW_DIR) {
- int dfd = openat(ftwbuf->at_fd, ftwbuf->at_path, O_DIRECTORY);
+ int flags = 0;
+#ifdef O_DIRECTORY
+ flags |= O_DIRECTORY;
+#endif
+ int dfd = openat(ftwbuf->at_fd, ftwbuf->at_path, flags);
if (dfd < 0) {
eval_error(state);
goto done;