Skip to content

Commit

Permalink
path-util: make find_executable() work without /proc mounted
Browse files Browse the repository at this point in the history
Follow-up for 888f65a.

Hopefully fixes systemd#20514.
  • Loading branch information
yuwata committed Aug 23, 2021
1 parent ded8039 commit 93413ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/basic/path-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,11 @@ static int check_x_access(const char *path, int *ret_fd) {
return r;

r = access_fd(fd, X_OK);
if (r < 0)
if (r == -ENOSYS) {
/* /proc is not mounted. Fallback to access(). */
if (access(path, X_OK) < 0)
return -errno;
} else if (r < 0)
return r;

if (ret_fd)
Expand Down

0 comments on commit 93413ac

Please sign in to comment.