Sat Aug 25 02:42:49 2018 UTC ()
PR bin/53548

Deal with the new shell internal exit reason EXEXIT in the case of
a shell which has vfork()'d.   It takes a peculiar set of circumstances
to get into a situation where this is ever relevant, but it can be
done.   See the PR for details.


(kre)
diff -r1.160 -r1.161 src/bin/sh/eval.c

cvs diff -r1.160 -r1.161 src/bin/sh/eval.c (expand / switch to context diff)
--- src/bin/sh/eval.c 2018/08/22 20:08:54 1.160
+++ src/bin/sh/eval.c 2018/08/25 02:42:49 1.161
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.160 2018/08/22 20:08:54 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.161 2018/08/25 02:42:49 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.160 2018/08/22 20:08:54 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.161 2018/08/25 02:42:49 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1085,7 +1085,8 @@
 						vforked = 2;
 						_exit(0);
 					} else {
-						_exit(exerrno);
+						_exit(exception == EXEXIT ?
+						    exitstatus : exerrno);
 					}
 				}
 				savehandler = handler;