aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/opendir.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-02-22 00:55:36 +0000
committerRoland McGrath <roland@gnu.org>2003-02-22 00:55:36 +0000
commite8783fd53d5d673eab4500d2cac82601f2f802e0 (patch)
tree153d45b1e7c9b279d5304b4cc88e495aa9341363 /sysdeps/mach/hurd/opendir.c
parent113d33e776f6ab899016aa2220b8a43a271f5e7f (diff)
downloadglibc-e8783fd53d5d673eab4500d2cac82601f2f802e0.tar
glibc-e8783fd53d5d673eab4500d2cac82601f2f802e0.tar.gz
glibc-e8783fd53d5d673eab4500d2cac82601f2f802e0.tar.bz2
glibc-e8783fd53d5d673eab4500d2cac82601f2f802e0.zip
* malloc/Versions (GLIBC_PRIVATE): Add __libc_thread_freeres.
* malloc/thread-freeres.c: New file. * malloc/Makefile (aux): Add it. * sunrpc/Versions (GLIBC_PRIVATE): Removed. * sunrpc/rpc_thread.c (__rpc_thread_destroy): Put in special section "__libc_thread_freeres_fn" and add to __libc_thread_subfreeres set. * sysdeps/unix/sysv/linux/i386/geteuid.c (__geteuid): Typo fix. * sysdeps/unix/sysv/linux/i386/getgid.c (__getgid): Typo fix. 2003-02-21 Roland McGrath <roland@frob.com> * sysdeps/mach/hurd/opendir.c (__opendir): Use O_NONBLOCK in open. * iconvdata/Makefile (tests): Add bug-iconv3 only if [$(have-thread-library) = yes].
Diffstat (limited to 'sysdeps/mach/hurd/opendir.c')
-rw-r--r--sysdeps/mach/hurd/opendir.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index 587b608107..a1ff947f06 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,94,95,96,97,98,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1993,94,95,96,97,98,2001,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,17 +50,22 @@ __opendir (const char *name)
{
/* Append trailing slash to directory name to force ENOTDIR
- if it's not a directory. */
+ if it's not a directory.
+
+ We open using the O_NONBLOCK flag so that a nondirectory with
+ blocking behavior (FIFO or device) gets ENOTDIR immediately
+ rather than waiting for the special file's open wakeup predicate. */
+
size_t len = strlen (name);
if (name[len - 1] == '/')
- fd = __open (name, O_RDONLY);
+ fd = __open (name, O_RDONLY | O_NONBLOCK);
else
{
char n[len + 2];
memcpy (n, name, len);
n[len] = '/';
n[len + 1] = '\0';
- fd = __open (n, O_RDONLY);
+ fd = __open (n, O_RDONLY | O_NONBLOCK);
}
}
if (fd < 0)