about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nq.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/nq.c b/nq.c
index 6d3d919..9ef1955 100644
--- a/nq.c
+++ b/nq.c
@@ -44,6 +44,10 @@
 #include <time.h>
 #include <unistd.h>
 
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 0
+#endif
+
 #ifdef NEED_DPRINTF
 #include <stdarg.h>
 static int
@@ -157,11 +161,7 @@ usage:
 		}
 	}
 
-#ifdef O_DIRECTORY
 	dirfd = open(path, O_RDONLY | O_DIRECTORY);
-#else
-	dirfd = open(path, O_RDONLY);
-#endif
 	if (dirfd < 0) {
 		perror("dir open");
 		exit(111);
@@ -176,11 +176,7 @@ usage:
 			}
 		}
 
-#ifdef O_DIRECTORY
 		donedirfd = open(donepath, O_RDONLY | O_DIRECTORY);
-#else
-		donedirfd = open(donepath, O_RDONLY);
-#endif
 		if (donedirfd < 0) {
 			perror("dir open");
 			exit(111);