projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ded8039
)
path-util: make find_executable() work without /proc mounted
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Sun, 22 Aug 2021 21:16:48 +0000
(06:16 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 23 Aug 2021 17:04:24 +0000
(
02:04
+0900)
Follow-up for
888f65ace6296ed61285d31db846babf1c11885e
.
Hopefully fixes #20514.
src/basic/path-util.c
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index d11f254a9f6af8927844d418dcdd28a8d6d4bc03..a21981616b5966abe5f441deb21bf0652eb8bf76 100644
(file)
--- a/
src/basic/path-util.c
+++ b/
src/basic/path-util.c
@@
-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)