Source-Changes-HG archive

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

[src/trunk]: src/bin/sh PR/7814: Matthias Scheler: shell does not fork for bu...



details:   https://anonhg.NetBSD.org/src/rev/d7aeb1da82d8
branches:  trunk
changeset: 474039:d7aeb1da82d8
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jun 26 16:31:47 1999 +0000

description:
PR/7814: Matthias Scheler: shell does not fork for builtins in backquotes,
leading to unexpected behaviour. Disable the no-fork optimization for now.
We need to revisit this and keep enough state around to recover from such
changes.

diffstat:

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

diffs (39 lines):

diff -r 10966827b92c -r d7aeb1da82d8 bin/sh/eval.c
--- a/bin/sh/eval.c     Sat Jun 26 16:26:57 1999 +0000
+++ b/bin/sh/eval.c     Sat Jun 26 16:31:47 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.45 1999/02/04 16:17:39 christos Exp $       */
+/*     $NetBSD: eval.c,v 1.46 1999/06/26 16:31:47 christos Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.45 1999/02/04 16:17:39 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.46 1999/06/26 16:31:47 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -546,10 +546,19 @@
                exitstatus = 0;
                goto out;
        }
+#ifdef notyet
+       /*
+        * For now we disable executing builtins in the same
+        * context as the shell, because we are not keeping
+        * enough state to recover from changes that are
+        * supposed only to affect subshells. eg. echo "`cd /`"
+        */
        if (n->type == NCMD) {
                exitstatus = oexitstatus;
                evalcommand(n, EV_BACKCMD, result);
-       } else {
+       } else
+#endif
+       {
                exitstatus = 0;
                if (pipe(pip) < 0)
                        error("Pipe call failed");



Home | Main Index | Thread Index | Old Index