Module Name: src
Committed By: christos
Date: Fri Jan 2 19:56:20 UTC 2015
Modified Files:
src/bin/sh: eval.c options.h
Log Message:
Define an undocumented -F option to only use fork instead of vfork for
debugging purposes.
To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/bin/sh/eval.c
cvs rdiff -u -r1.20 -r1.21 src/bin/sh/options.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.109 src/bin/sh/eval.c:1.110
--- src/bin/sh/eval.c:1.109 Sat May 31 10:42:18 2014
+++ src/bin/sh/eval.c Fri Jan 2 14:56:20 2015
@@ -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 @@ evalcommand(union node *cmd, int flgs, s
* 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;
Index: src/bin/sh/options.h
diff -u src/bin/sh/options.h:1.20 src/bin/sh/options.h:1.21
--- src/bin/sh/options.h:1.20 Sat Jun 18 17:18:46 2011
+++ src/bin/sh/options.h Fri Jan 2 14:56:20 2015
@@ -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 @@ DEF_OPT( "cdprint", 0 ) /* always print
#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