aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-18 15:35:09 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-18 15:35:09 +0000
commit74f7e7c0bd84e02763d0abd213990e5bf2466e47 (patch)
tree322b41e5cef5419c76baa27e451c1b7236ac984b
parent67479a700e3bd2e52980c00ac35c888589ac0a36 (diff)
downloadglibc-74f7e7c0bd84e02763d0abd213990e5bf2466e47.zip
glibc-74f7e7c0bd84e02763d0abd213990e5bf2466e47.tar.gz
glibc-74f7e7c0bd84e02763d0abd213990e5bf2466e47.tar.bz2
Update.
* sysdeps/posix/getcwd.c (__getcwd): Don't stop processing directory entries when a lstat call fails. Patch by Colin Plumb <colin@nyx.net>.
-rw-r--r--ChangeLog4
-rw-r--r--nscd/TODO2
-rw-r--r--sysdeps/posix/getcwd.c15
3 files changed, 11 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index eda87f4..d160409 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
1998-10-18 Ulrich Drepper <drepper@cygnus.com>
+ * sysdeps/posix/getcwd.c (__getcwd): Don't stop processing
+ directory entries when a lstat call fails.
+ Patch by Colin Plumb <colin@nyx.net>.
+
* resolv/nss_dns/dns-host.c: Add missing errnop parameter to the
NSS functions.
* resolv/nss_dns/dns-network.c: Likewise.
diff --git a/nscd/TODO b/nscd/TODO
index a0b8427..0ae9d18 100644
--- a/nscd/TODO
+++ b/nscd/TODO
@@ -1,5 +1,3 @@
* If we have reached the max. # of process, close accept socket.
! THIS COULD CAUSE THE KERNEL TO HANG ! BE CAREFUL !
-
-* Implement cache for hosts
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 7de5fd3..df48804 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -333,14 +333,13 @@ __getcwd (buf, size)
name[dotlist + dotsize - dotp] = '/';
strcpy (&name[dotlist + dotsize - dotp + 1], d->d_name);
#endif
- if (__lstat (name, &st) < 0)
- {
- int save = errno;
- (void) __closedir (dirstream);
- __set_errno (save);
- goto lose;
- }
- if (st.st_dev == thisdev && st.st_ino == thisino)
+ /* We don't fail here if we cannot stat() a directory entry.
+ This can happen when (network) filesystems fail. If this
+ entry is in fact the one we are looking for we will find
+ out soon as we reach the end of the directory without
+ having found anything. */
+ if (__lstat (name, &st) >= 0
+ && st.st_dev == thisdev && st.st_ino == thisino)
break;
}
}