about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-02-23 09:47:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-02-23 09:47:05 +0000
commit4bfb5daa7ee0f3d2318ddd244e70fcb169f41e64 (patch)
tree31d0195778e601bb6c09bd9d50fac126419bc981
parentdbbcbf67cb8a330e5c7d8a40ed4152a53db6b5f8 (diff)
downloadzsh-4bfb5daa7ee0f3d2318ddd244e70fcb169f41e64.tar.gz
zsh-4bfb5daa7ee0f3d2318ddd244e70fcb169f41e64.tar.xz
zsh-4bfb5daa7ee0f3d2318ddd244e70fcb169f41e64.zip
28795 plus typos noticed by Mikael: careful with forked shells
-rw-r--r--ChangeLog7
-rw-r--r--Src/exec.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index cb9dcfd71..c4764453d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 28795: Src/exec.c: tweak to 28791 for forked shells.
+	Also (unposted) typos in comments noticed by Mikael.
+
 2011-02-22  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 28791: Doc/Zsh/options.yo, Src/builtin.c, Src/exec.c,
@@ -14248,5 +14253,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5206 $
+* $Revision: 1.5207 $
 *****************************************************
diff --git a/Src/exec.c b/Src/exec.c
index 25a2eee38..f1b87e152 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3300,14 +3300,16 @@ execcmd(Estate state, int input, int output, int how, int last1)
     if (isset(POSIXBUILTINS) &&
 	(cflags & (BINF_PSPECIAL|BINF_EXEC))) {
 	/*
-	 * For POSIX-compatibile behaviour with special
+	 * For POSIX-compatible behaviour with special
 	 * builtins (including exec which we don't usually
-	 * classify as a builtin, we treat all errors as fatal.
+	 * classify as a builtin) we treat all errors as fatal.
 	 */
 	if (redir_err || errflag) {
 	    if (!isset(INTERACTIVE)) {
-		/* We've already _exit'ed if forked */
-		exit(1);
+		if (forked)
+		    _exit(1);
+		else
+		    exit(1);
 	    }
 	    errflag = 1;
 	}