summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-18 22:32:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-18 22:32:40 +0000
commit2ea436fb13abd2793dc39cca24a8f90d8f3b6328 (patch)
tree3a432e73a76ea38beb521127d91165e987328419
parent434e9e3cba0f57fca25e1ed2bc4444fac59e4fef (diff)
execXp should go to next PATH dir on any error except ENOEXEC,
not just on ENOENT (in particular, on EPERM). At least glibc does so. Fixing this.
-rw-r--r--libc/unistd/exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c
index 47aab27e7..b2817af5e 100644
--- a/libc/unistd/exec.c
+++ b/libc/unistd/exec.c
@@ -235,11 +235,11 @@ int execvp(const char *path, char *const argv[])
if (strchr(path, '/')) {
execve(path, argv, __environ);
- CHECK_ENOEXEC:
if (errno == ENOEXEC) {
char **nargv;
EXEC_ALLOC_SIZE(size2) /* Do NOT add a semicolon! */
size_t n;
+ RUN_BIN_SH:
/* Need the dimension - 1. We omit counting the trailing
* NULL but we actually omit the first entry. */
for (n=0 ; argv[n] ; n++) {}
@@ -292,9 +292,9 @@ int execvp(const char *path, char *const argv[])
seen_small = 1;
- if (errno != ENOENT) {
+ if (errno == ENOEXEC) {
path = s;
- goto CHECK_ENOEXEC;
+ goto RUN_BIN_SH;
}
NEXT: