summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1995-06-12 19:38:02 +0000
committerjtc <jtc@NetBSD.org>1995-06-12 19:38:02 +0000
commita646349d2beecf9d70a7f76809efa607264cefe7 (patch)
tree201c2c02b309c3c3354d1cda2a4821dbbe5e28a6 /lib/libc
parent66f34029e5b1324b5627581d0b52440421952c2d (diff)
Open with O_NONBLOCK, in case someone tries to open a blocking device
or a non-open fifo instead of a directory.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/opendir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c
index 82f2947d7f4..29f604d16c7 100644
--- a/lib/libc/gen/opendir.c
+++ b/lib/libc/gen/opendir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: opendir.c,v 1.8 1995/02/25 08:51:28 cgd Exp $ */
+/* $NetBSD: opendir.c,v 1.9 1995/06/12 19:38:02 jtc Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)opendir.c 8.7 (Berkeley) 12/10/94";
#else
-static char rcsid[] = "$NetBSD: opendir.c,v 1.8 1995/02/25 08:51:28 cgd Exp $";
+static char rcsid[] = "$NetBSD: opendir.c,v 1.9 1995/06/12 19:38:02 jtc Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -74,7 +74,7 @@ __opendir2(name, flags)
int incr;
int unionstack;
- if ((fd = open(name, O_RDONLY)) == -1)
+ if ((fd = open(name, O_RDONLY | O_NONBLOCK)) == -1)
return (NULL);
if (fstat(fd, &sb) || !S_ISDIR(sb.st_mode)) {
errno = ENOTDIR;