From e8783fd53d5d673eab4500d2cac82601f2f802e0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 22 Feb 2003 00:55:36 +0000 Subject: * 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 * sysdeps/mach/hurd/opendir.c (__opendir): Use O_NONBLOCK in open. * iconvdata/Makefile (tests): Add bug-iconv3 only if [$(have-thread-library) = yes]. --- sysdeps/mach/hurd/opendir.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sysdeps/mach/hurd/opendir.c') 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) -- cgit 1.4.1