@@ -1878,7 +1878,6 @@ open_path (const char *name, size_t namelen, int mode,
size_t cnt;
char *edp;
int here_any = 0;
- int err;
/* If we are debugging the search for libraries print the path
now if it hasn't happened now. */
@@ -1979,9 +1978,6 @@ open_path (const char *name, size_t namelen, int mode,
return -1;
}
}
- if (here_any && (err = errno) != ENOENT && err != EACCES)
- /* The file exists and is readable, but something went wrong. */
- return -1;
/* Remember whether we found anything. */
any |= here_any;
@@ -2002,6 +1998,8 @@ open_path (const char *name, size_t namelen, int mode,
sps->dirs = (void *) -1;
}
+ /* The errno is used by _dl_signal_error. */
+ __set_errno (ENOENT);
return -1;
}