diff --git a/src/process/execvp.c b/src/process/execvp.c index 480a85e9383ef1054e6633dd22a45fd9f6506287..2dddeddb16a5eafe2f29292b1961a108483ae2fb 100644 --- a/src/process/execvp.c +++ b/src/process/execvp.c @@ -39,8 +39,15 @@ int __execvpe(const char *file, char *const argv[], char *const envp[]) b[z-p] = '/'; memcpy(b+(z-p)+(z>p), file, k+1); execve(b, argv, envp); - if (errno == EACCES) seen_eacces = 1; - else if (errno != ENOENT && errno != ENOTDIR) return -1; + switch (errno) { + case EACCES: + seen_eacces = 1; + case ENOENT: + case ENOTDIR: + break; + default: + return -1; + } if (!*z++) break; } if (seen_eacces) errno = EACCES;