Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Define an undocumented -F option to only use fork ins...



details:   https://anonhg.NetBSD.org/src/rev/52cc524b8eef
branches:  trunk
changeset: 805449:52cc524b8eef
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 02 19:56:20 2015 +0000

description:
Define an undocumented -F option to only use fork instead of vfork for
debugging purposes.

diffstat:

 bin/sh/eval.c    |  6 +++---
 bin/sh/options.h |  6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r c696ca83d62d -r 52cc524b8eef bin/sh/eval.c
--- a/bin/sh/eval.c     Fri Jan 02 19:50:02 2015 +0000
+++ b/bin/sh/eval.c     Fri Jan 02 19:56:20 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.109 2014/05/31 14:42:18 christos Exp $      */
+/*     $NetBSD: eval.c,v 1.110 2015/01/02 19:56:20 christos 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.109 2014/05/31 14:42:18 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.110 2015/01/02 19:56:20 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -860,7 +860,7 @@
                 * child's address space is actually shared with the parent as
                 * we rely on this.
                 */
-               if (cmdentry.cmdtype == CMDNORMAL) {
+               if (usefork == 0 && cmdentry.cmdtype == CMDNORMAL) {
                        pid_t   pid;
                        int serrno;
 
diff -r c696ca83d62d -r 52cc524b8eef bin/sh/options.h
--- a/bin/sh/options.h  Fri Jan 02 19:50:02 2015 +0000
+++ b/bin/sh/options.h  Fri Jan 02 19:56:20 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.h,v 1.20 2011/06/18 21:18:46 christos Exp $    */
+/*     $NetBSD: options.h,v 1.21 2015/01/02 19:56:20 christos Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -99,9 +99,11 @@
 #define        cdprint optlist[17].val
 DEF_OPT( "tabcomplete",        0 )     /* <tab> causes filename expansion */
 #define        tabcomplete optlist[18].val
+DEF_OPT( "fork",       'F' )   /* use fork(2) instead of vfork(2) */
+#define        usefork optlist[19].val
 #ifdef DEBUG
 DEF_OPT( "debug",      0 )     /* enable debug prints */
-#define        debug optlist[19].val
+#define        debug optlist[20].val
 #endif
 
 #ifdef DEFINE_OPTIONS



Home | Main Index | Thread Index | Old Index