Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 18 Oct 1998 15:35:09 +0000 (15:35 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 18 Oct 1998 15:35:09 +0000 (15:35 +0000)
* sysdeps/posix/getcwd.c (__getcwd): Don't stop processing
directory entries when a lstat call fails.
Patch by Colin Plumb <colin@nyx.net>.

ChangeLog
nscd/TODO
sysdeps/posix/getcwd.c

index eda87f4f808df2ea8b30fb2b103489ce60b1295e..d160409544173b584867b5be577384f545947961 100644 (file)
--- 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.
index a0b8427ad3f8853464b0fd082b810bd5facafa89..0ae9d1845c1acb669ba14675aea2ab8fa00b183a 100644 (file)
--- 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
index 7de5fd3a75070c0e095f6461f58857d9db81e38d..df48804f7a3ae397081a96b65a83316f2774ad31 100644 (file)
@@ -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;
            }
        }