diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-01-20 21:17:38 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-01-20 21:17:38 +0000 |
commit | 2f156993495317477d92f02aa05c674cab8e3805 (patch) | |
tree | 1c2455215c2d5387f9c0f3e5400a5ec911c3f3d5 | |
parent | a4f17630670ecf9177b370f9edca4020c5e4131d (diff) | |
download | glibc-2f156993495317477d92f02aa05c674cab8e3805.tar.gz glibc-2f156993495317477d92f02aa05c674cab8e3805.tar.xz glibc-2f156993495317477d92f02aa05c674cab8e3805.zip |
.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | sysdeps/unix/fdopendir.c | 12 |
2 files changed, 1 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog index f917969eff..785c547d74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,5 @@ 2006-01-20 Ulrich Drepper <drepper@redhat.com> - * sysdeps/unix/fdopendir.c (fdopendir): If O_DIRECTORY is - available, avoid stat call, use fcntl result to determine whether - descriptor is for a directory or not. * dirent/Makefile (tests): Add tst-fdopendir2. * dirent/tst-fdopendir2.c: New file. diff --git a/sysdeps/unix/fdopendir.c b/sysdeps/unix/fdopendir.c index b586e58ca4..528f180fcb 100644 --- a/sysdeps/unix/fdopendir.c +++ b/sysdeps/unix/fdopendir.c @@ -29,7 +29,6 @@ fdopendir (int fd) { struct stat64 statbuf; -#ifndef O_DIRECTORY if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0) return NULL; if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0)) @@ -37,20 +36,11 @@ fdopendir (int fd) __set_errno (ENOTDIR); return NULL; } -#endif - /* Make sure the descriptor allows for reading (and eventually that - the descriptor is for a directory). */ + /* Make sure the descriptor allows for reading. */ int flags = __fcntl (fd, F_GETFL); if (__builtin_expect (flags == -1, 0)) return NULL; -#ifdef O_DIRECTORY - if (__builtin_expect ((flags & O_DIRECTORY) == 0, 0)) - { - __set_errno (ENOTDIR); - return NULL; - } -#endif if (__builtin_expect ((flags & O_ACCMODE) == O_WRONLY, 0)) { __set_errno (EINVAL); |