diff --git a/shell/ash.c b/shell/ash.c index 79ade5df4..ad50537a1 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8098,15 +8098,15 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) /* Map to POSIX errors */ switch (e) { - case EACCES: + default: exerrno = 126; break; + case ELOOP: + case ENAMETOOLONG: case ENOENT: + case ENOTDIR: exerrno = 127; break; - default: - exerrno = 2; - break; } exitstatus = exerrno; TRACE(("shellexec failed for %s, errno %d, suppress_int %d\n",