about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-06-23 18:30:55 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-06-23 18:30:55 +0000
commitf11e227cb010cab274715e7db816d7406dc62c19 (patch)
tree2332193d34ed30c833c820bad321b77c81a31fcd
parent791e11a084882f69e1e7373c80024d3f78b10baa (diff)
downloadzsh-f11e227cb010cab274715e7db816d7406dc62c19.tar.gz
zsh-f11e227cb010cab274715e7db816d7406dc62c19.tar.xz
zsh-f11e227cb010cab274715e7db816d7406dc62c19.zip
POSIX exit status changes.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4db9eebac..5a06dbc68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-23  Bart Schaefer  <schaefer@zsh.org>
+
+	* 15050, 15054: Src/exec.c: Change exit status of external
+	commands that could not be executed, to comply with POSIX.
+
 2001-06-22  Andrej Borsenkow  <bor@zsh.org>
 
 	* 15021: Src/prompt.c, Doc/Zsh/prompt.yo: revert to old %l
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; }