summary refs log tree commit diff
path: root/fq.c
diff options
context:
space:
mode:
Diffstat (limited to 'fq.c')
-rw-r--r--fq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fq.c b/fq.c
index dc165db..313f773 100644
--- a/fq.c
+++ b/fq.c
@@ -83,9 +83,11 @@ main(int argc, char *argv[])
 	if (!path)
 		path = ".";
 
-	dirfd = open(path, O_RDONLY);
-	if (dirfd < 0)
+	dirfd = open(path, O_RDONLY | O_DIRECTORY);
+	if (dirfd < 0) {
+		perror("open dir");
 		exit(111);
+	}
 
 	if (optind == argc) {	/* behave as if $NQDIR/,* was passed. */
 		DIR *dir;