about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-30 03:21:39 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-30 03:21:39 +0000
commitf58580396d75a6d7429a909444ad8b70dd7dfff8 (patch)
treebd973785675addecb446ba36e57d8f8d8f918271 /elf
parent5a384a9143afd73965e152cbbd13356b57d58c06 (diff)
downloadglibc-f58580396d75a6d7429a909444ad8b70dd7dfff8.tar.gz
glibc-f58580396d75a6d7429a909444ad8b70dd7dfff8.tar.xz
glibc-f58580396d75a6d7429a909444ad8b70dd7dfff8.zip
Update.
	* elf/dl-load.c (open_path): Don't exit loop early if we didn't
	use a directory at all.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index e1a579186f..dc1d57ff0a 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1334,6 +1334,7 @@ open_path (const char *name, size_t namelen, int preloaded,
       size_t buflen = 0;
       size_t cnt;
       char *edp;
+      int here_any = 0;
 
       /* If we are debugging the search for libraries print the path
 	 now if it hasn't happened now.  */
@@ -1384,7 +1385,7 @@ open_path (const char *name, size_t namelen, int preloaded,
 	    }
 
 	  /* Remember whether we found any existing directory.  */
-	  any |= this_dir->status[cnt] == existing;
+	  here_any |= this_dir->status[cnt] == existing;
 
 	  if (fd != -1 && preloaded && __libc_enable_secure)
 	    {
@@ -1424,9 +1425,12 @@ open_path (const char *name, size_t namelen, int preloaded,
 	      return -1;
 	    }
 	}
-      if (errno != ENOENT && errno != EACCES)
+      if (here_any && errno != ENOENT && errno != EACCES)
 	/* The file exists and is readable, but something went wrong.  */
 	return -1;
+
+      /* Remember whether we found anything.  */
+      any |= here_any;
     }
   while (*++dirs != NULL);