* elf/dl-load.c (open_path): Don't exit loop early if we didn't
use a directory at all.
2000-10-29 Ulrich Drepper <drepper@redhat.com>
+ * elf/dl-load.c (open_path): Don't exit loop early if we didn't
+ use a directory at all.
+
* elf/Makefile: Add rules to build and run tst-pathopt.
* elf/tst-pathopt.c: New file.
* elf/tst-pathopt.sh: New file.
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. */
}
/* 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)
{
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);