From f11e227cb010cab274715e7db816d7406dc62c19 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 23 Jun 2001 18:30:55 +0000 Subject: POSIX exit status changes. --- Src/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 426d151b5..16ff92392 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -502,7 +502,7 @@ execute(Cmdnam not_used_yet, int dash) (arg0[0] == '.' && (arg0 + 1 == s || (arg0[1] == '.' && arg0 + 2 == s)))) { zerr("%e: %s", arg0, errno); - _exit(1); + _exit((errno == EACCES || errno == ENOEXEC) ? 126 : 127); } break; } @@ -556,7 +556,7 @@ execute(Cmdnam not_used_yet, int dash) zerr("%e: %s", arg0, eno); else zerr("command not found: %s", arg0, 0); - _exit(1); + _exit((eno == EACCES || eno == ENOEXEC) ? 126 : 127); } #define RET_IF_COM(X) { if (iscom(X)) return docopy ? dupstring(X) : arg0; } -- cgit 1.4.1