Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh PR bin/53548



details:   https://anonhg.NetBSD.org/src/rev/f67df8f58191
branches:  trunk
changeset: 365634:f67df8f58191
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Aug 25 02:42:49 2018 +0000

description:
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.

diffstat:

 bin/sh/eval.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 7929b5c07eca -r f67df8f58191 bin/sh/eval.c
--- a/bin/sh/eval.c     Sat Aug 25 00:09:12 2018 +0000
+++ b/bin/sh/eval.c     Sat Aug 25 02:42:49 2018 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index