Index: trunk/src/kash/eval.c
===================================================================
--- trunk/src/kash/eval.c	(revision 3434)
+++ trunk/src/kash/eval.c	(revision 3435)
@@ -773,5 +773,5 @@
  *      evalcommand_out, evalcommand_parent, evalcommand_doit, evalcommand_child
  */
-/*int vforked = 0;*/
+/*int vforked = 0; - obsolete */
 
 /* Both child and parent exits thru here. */
@@ -983,11 +983,10 @@
 			trputs(psh, "normal command:  ");  trargs(psh, args->argv);
 #endif
-			clearredir(psh, psh->vforked);
-			redirect(psh, cmd->ncmd.redirect, psh->vforked ? REDIR_VFORK : 0);
-			if (!psh->vforked)
-				for (sp = args->varlist.list ; sp ; sp = sp->next)
-					setvareq(psh, sp->text, VEXPORT|VSTACK);
+			clearredir(psh);
+			redirect(psh, cmd->ncmd.redirect, 0);
+			for (sp = args->varlist.list ; sp ; sp = sp->next)
+                                setvareq(psh, sp->text, VEXPORT|VSTACK);
 			envp = environment(psh);
-			shellexec(psh, args->argv, envp, args->path, args->cmdentry.u.index, psh->vforked);
+			shellexec(psh, args->argv, envp, args->path, args->cmdentry.u.index);
 			break;
 		}
@@ -1014,5 +1013,4 @@
 	const char *path = pathval(psh);
 
-	psh->vforked = 0;
 	/* First expand the arguments. */
 	TRACE((psh, "evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
@@ -1153,7 +1151,5 @@
 
 		if (flags & EV_BACKCMD) {
-			if (!psh->vforked) {
-				FORCEINTON;
-			}
+                        FORCEINTON;
 			shfile_close(&psh->fdtab, pip[0]);
 			if (pip[1] != 1) {
@@ -1304,5 +1300,5 @@
 		for (sp = psh->cmdenviron; sp; sp = sp->next)
 			setvareq(psh, sp->text, VEXPORT|VSTACK);
-		shellexec(psh, argv + 1, environment(psh), pathval(psh), 0, 0);
+		shellexec(psh, argv + 1, environment(psh), pathval(psh), 0);
 	}
 	return 0;
Index: trunk/src/kash/exec.c
===================================================================
--- trunk/src/kash/exec.c	(revision 3434)
+++ trunk/src/kash/exec.c	(revision 3435)
@@ -99,5 +99,5 @@
 
 
-STATIC void tryexec(shinstance *, char *, char **, char **, int, int);
+STATIC void tryexec(shinstance *, char *, char **, char **, int);
 STATIC void execinterp(shinstance *, char **, char **);
 STATIC void printentry(shinstance *, struct tblentry *, int);
@@ -118,5 +118,5 @@
 
 SH_NORETURN_1 void
-shellexec(shinstance *psh, char **argv, char **envp, const char *path, int idx, int vforked)
+shellexec(shinstance *psh, char **argv, char **envp, const char *path, int idx)
 {
 	char *cmdname;
@@ -144,5 +144,5 @@
 		cmdname = stalloc(psh, argv0len + 5);
 		strcpy(cmdname, argv0);
-		tryexec(psh, cmdname, argv, envp, vforked, has_ext);
+		tryexec(psh, cmdname, argv, envp, has_ext);
 		TRACE((psh, "shellexec: cmdname=%s\n", cmdname));
 		stunalloc(psh, cmdname);
@@ -165,5 +165,5 @@
 		while ((cmdname = padvance(psh, &path, argv0)) != NULL) {
 			if (--idx < 0 && psh->pathopt == NULL) {
-				tryexec(psh, cmdname, argv, envp, vforked, has_ext);
+				tryexec(psh, cmdname, argv, envp, has_ext);
 				if (errno != ENOENT && errno != ENOTDIR)
 					e = errno;
@@ -185,6 +185,6 @@
 		break;
 	}
-	TRACE((psh, "shellexec failed for '%s', errno %d, vforked %d, suppressint %d\n",
-		argv[0], e, vforked, psh->suppressint ));
+	TRACE((psh, "shellexec failed for '%s', errno %d, suppressint %d\n",
+		argv[0], e, psh->suppressint ));
 	exerror(psh, EXEXEC, "%s: %s", argv[0], errmsg(psh, e, E_EXEC));
 	/* NOTREACHED */
@@ -193,5 +193,5 @@
 
 STATIC void
-tryexec(shinstance *psh, char *cmd, char **argv, char **envp, int vforked, int has_ext)
+tryexec(shinstance *psh, char *cmd, char **argv, char **envp, int has_ext)
 {
 	int e;
@@ -220,11 +220,4 @@
 	e = errno;
 	if (e == ENOEXEC) {
-		if (vforked) {
-			/* We are currently vfork(2)ed, so raise an
-			 * exception, and evalcommand will try again
-			 * with a normal fork(2).
-			 */
-			exraise(psh, EXSHELLPROC);
-		}
 		initshellproc(psh);
 		setinputfile(psh, cmd, 0);
@@ -347,5 +340,5 @@
 	    /* nothing*/;
 	TRACE((psh, "hash bang '%s'\n", new[0]));
-	shellexec(psh, new, envp, pathval(psh), 0, 0);
+	shellexec(psh, new, envp, pathval(psh), 0);
 	/* NOTREACHED */
 }
Index: trunk/src/kash/exec.h
===================================================================
--- trunk/src/kash/exec.h	(revision 3434)
+++ trunk/src/kash/exec.h	(revision 3435)
@@ -71,5 +71,5 @@
 #endif
 
-SH_NORETURN_1 void shellexec(struct shinstance *, char **, char **, const char *, int, int) SH_NORETURN_2;
+SH_NORETURN_1 void shellexec(struct shinstance *, char **, char **, const char *, int) SH_NORETURN_2;
 char *padvance(struct shinstance *, const char **, const char *);
 int hashcmd(struct shinstance *, int, char **);
Index: trunk/src/kash/generated/init.c
===================================================================
--- trunk/src/kash/generated/init.c	(revision 3434)
+++ trunk/src/kash/generated/init.c	(revision 3435)
@@ -276,5 +276,5 @@
       /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/redir.c: */
       {
-	      clearredir(psh, 0);
+	      clearredir(psh);
       }
 
@@ -283,5 +283,5 @@
 	      char *sm;
 
-	      clear_traps(psh, 0);
+	      clear_traps(psh);
 	      for (sm = psh->sigmode ; sm < psh->sigmode + NSIG ; sm++) {
 		      if (*sm == S_IGN)
Index: trunk/src/kash/input.c
===================================================================
--- trunk/src/kash/input.c	(revision 3434)
+++ trunk/src/kash/input.c	(revision 3435)
@@ -565,8 +565,6 @@
 
 void
-closescript(shinstance *psh, int vforked)
-{
-	if (vforked)
-		return;
+closescript(shinstance *psh)
+{
 	popallfiles(psh);
 	if (psh->parsefile->fd > 0) {
Index: trunk/src/kash/input.h
===================================================================
--- trunk/src/kash/input.h	(revision 3434)
+++ trunk/src/kash/input.h	(revision 3435)
@@ -58,5 +58,5 @@
 void popfile(struct shinstance *);
 void popallfiles(struct shinstance *);
-void closescript(struct shinstance *, int);
+void closescript(struct shinstance *);
 
 #define pgetc_macro(psh)	(--(psh)->parsenleft >= 0? *(psh)->parsenextc++ : preadbuffer(psh))
Index: trunk/src/kash/jobs.c
===================================================================
--- trunk/src/kash/jobs.c	(revision 3434)
+++ trunk/src/kash/jobs.c	(revision 3435)
@@ -86,5 +86,5 @@
 #ifdef KASH_USE_FORKSHELL2
 static int forkparent(shinstance *psh, struct job *jp, union node *n, int mode, pid_t pid);
-static void forkchild(shinstance *psh, struct job *jp, union node *n, int mode, int vforked);
+static void forkchild(shinstance *psh, struct job *jp, union node *n, int mode);
 #endif
 
@@ -149,7 +149,7 @@
 		} while (0);
 
-		setsignal(psh, SIGTSTP, 0);
-		setsignal(psh, SIGTTOU, 0);
-		setsignal(psh, SIGTTIN, 0);
+		setsignal(psh, SIGTSTP);
+		setsignal(psh, SIGTTOU);
+		setsignal(psh, SIGTTIN);
 		if (sh_getpgid(psh, 0) != psh->rootpid && sh_setpgid(psh, 0, psh->rootpid) == -1)
 			error(psh, "Cannot set process group (%s) at %d",
@@ -167,7 +167,7 @@
 		shfile_close(&psh->fdtab, psh->ttyfd);
 		psh->ttyfd = -1;
-		setsignal(psh, SIGTSTP, 0);
-		setsignal(psh, SIGTTOU, 0);
-		setsignal(psh, SIGTTIN, 0);
+		setsignal(psh, SIGTSTP);
+		setsignal(psh, SIGTTOU);
+		setsignal(psh, SIGTTIN);
 	}
 	psh->jobctl = on;
@@ -798,5 +798,5 @@
 		return -1; /* won't get here */
 	case 0:
-		forkchild(psh, jp, n, mode, 0);
+		forkchild(psh, jp, n, mode);
 		return 0;
 	default:
@@ -817,5 +817,5 @@
 		/* child */
 		(void)arglen;
-		forkchild(psh, jp, n, mode, 0);
+		forkchild(psh, jp, n, mode);
 		sh_exit(psh, child(psh, nchild, argp));
 		return 0;
@@ -866,5 +866,5 @@
 #endif
 void
-forkchild(shinstance *psh, struct job *jp, union node *n, int mode, int vforked)
+forkchild(shinstance *psh, struct job *jp, union node *n, int mode)
 {
 	int wasroot;
@@ -875,12 +875,10 @@
 	wasroot = psh->rootshell;
 	TRACE((psh, "Child shell %d\n", sh_getpid(psh)));
-	if (!vforked)
-		psh->rootshell = 0;
-
-	closescript(psh, vforked);
-	clear_traps(psh, vforked);
-#if JOBS
-	if (!vforked)
-		psh->jobctl = 0;		/* do job control only in root shell */
+	psh->rootshell = 0;
+
+	closescript(psh);
+	clear_traps(psh);
+#if JOBS
+	psh->jobctl = 0;		/* do job control only in root shell */
 	if (wasroot && mode != FORK_NOJOB && mflag(psh)) {
 		if (jp == NULL || jp->nprocs == 0)
@@ -896,9 +894,9 @@
 				    sh_strerror(psh, errno), __LINE__);
 		}
-		setsignal(psh, SIGTSTP, vforked);
-		setsignal(psh, SIGTTOU, vforked);
+		setsignal(psh, SIGTSTP);
+		setsignal(psh, SIGTTOU);
 	} else if (mode == FORK_BG) {
-		ignoresig(psh, SIGINT, vforked);
-		ignoresig(psh, SIGQUIT, vforked);
+		ignoresig(psh, SIGINT);
+		ignoresig(psh, SIGQUIT);
 		if ((jp == NULL || jp->nprocs == 0) &&
 		    ! fd0_redirected_p(psh)) {
@@ -910,6 +908,6 @@
 #else
 	if (mode == FORK_BG) {
-		ignoresig(psh, SIGINT, vforked);
-		ignoresig(psh, SIGQUIT, vforked);
+		ignoresig(psh, SIGINT);
+		ignoresig(psh, SIGQUIT);
 		if ((jp == NULL || jp->nprocs == 0) &&
 		    ! fd0_redirected_p(psh)) {
@@ -921,11 +919,10 @@
 #endif
 	if (wasroot && iflag(psh)) {
-		setsignal(psh, SIGINT, vforked);
-		setsignal(psh, SIGQUIT, vforked);
-		setsignal(psh, SIGTERM, vforked);
-	}
-
-	if (!vforked)
-		psh->jobs_invalid = 1;
+		setsignal(psh, SIGINT);
+		setsignal(psh, SIGQUIT);
+		setsignal(psh, SIGTERM);
+	}
+
+	psh->jobs_invalid = 1;
 }
 
Index: trunk/src/kash/jobs.h
===================================================================
--- trunk/src/kash/jobs.h	(revision 3434)
+++ trunk/src/kash/jobs.h	(revision 3435)
@@ -101,5 +101,5 @@
 #else
 int forkshell(struct shinstance *, struct job *, union node *, int);
-void forkchild(struct shinstance *, struct job *, union node *, int, int);
+void forkchild(struct shinstance *, struct job *, union node *, int);
 int forkparent(struct shinstance *, struct job *, union node *, int, pid_t);
 #endif
Index: trunk/src/kash/main.c
===================================================================
--- trunk/src/kash/main.c	(revision 3434)
+++ trunk/src/kash/main.c	(revision 3435)
@@ -241,5 +241,5 @@
 
 		for (i = 0; i < SIGSSIZE; i++)
-		    setsignal(psh, sigs[i], 0);
+		    setsignal(psh, sigs[i]);
 	}
 
Index: trunk/src/kash/redir.c
===================================================================
--- trunk/src/kash/redir.c	(revision 3434)
+++ trunk/src/kash/redir.c	(revision 3435)
@@ -114,7 +114,4 @@
 	memory[1] = flags & REDIR_BACKQ;
 	if (flags & REDIR_PUSH) {
-		/* We don't have to worry about REDIR_VFORK here, as
-		 * flags & REDIR_PUSH is never true if REDIR_VFORK is set.
-		 */
 		sv = ckmalloc(psh, sizeof (struct redirtab));
 		for (i = 0 ; i < 10 ; i++)
@@ -174,5 +171,5 @@
 	char *fname;
 	int f;
-	int oflags = O_WRONLY|O_CREAT|O_TRUNC, eflags;
+	int oflags = O_WRONLY|O_CREAT|O_TRUNC;
 
 	/*
@@ -186,12 +183,6 @@
 	case NFROM:
 		fname = redir->nfile.expfname;
-		if (flags & REDIR_VFORK)
-			eflags = O_NONBLOCK;
-		else
-			eflags = 0;
-		if ((f = shfile_open(&psh->fdtab, fname, O_RDONLY|eflags, 0)) < 0)
+		if ((f = shfile_open(&psh->fdtab, fname, O_RDONLY, 0)) < 0)
 			goto eopen;
-		if (eflags)
-			(void)shfile_fcntl(&psh->fdtab, f, F_SETFL, shfile_fcntl(&psh->fdtab, f, F_GETFL, 0) & ~eflags);
 		break;
 	case NFROMTO:
@@ -365,5 +356,5 @@
 
 SHELLPROC {
-	clearredir(psh, 0);
+	clearredir(psh);
 }
 
@@ -381,5 +372,5 @@
 
 void
-clearredir(shinstance *psh, int vforked)
+clearredir(shinstance *psh)
 {
 	struct redirtab *rp;
@@ -391,6 +382,5 @@
 				shfile_close(&psh->fdtab, rp->renamed[i]);
 			}
-			if (!vforked)
-				rp->renamed[i] = EMPTY;
+			rp->renamed[i] = EMPTY;
 		}
 	}
Index: trunk/src/kash/redir.h
===================================================================
--- trunk/src/kash/redir.h	(revision 3434)
+++ trunk/src/kash/redir.h	(revision 3435)
@@ -38,5 +38,5 @@
 #define REDIR_PUSH 01		/* save previous values of file descriptors */
 #define REDIR_BACKQ 02		/* save the command output in memory */
-#define REDIR_VFORK 04		/* running under vfork(2), be careful */
+//#define REDIR_VFORK 04		/* running under vfork(2), be careful */
 
 union node;
@@ -44,5 +44,5 @@
 void popredir(struct shinstance *);
 int fd0_redirected_p(struct shinstance *);
-void clearredir(struct shinstance *, int);
+void clearredir(struct shinstance *);
 int copyfd(struct shinstance *, int, int);
 int movefd(struct shinstance *, int, int);
Index: trunk/src/kash/shinstance.h
===================================================================
--- trunk/src/kash/shinstance.h	(revision 3434)
+++ trunk/src/kash/shinstance.h	(revision 3435)
@@ -178,7 +178,4 @@
     int                 skipcount;      /**< number of levels to skip */
     int                 loopnest;       /**< current loop nesting level */
-
-    /* eval.c */
-    int                 vforked; /** @todo remove this */
 
     /* expand.c */
Index: trunk/src/kash/trap.c
===================================================================
--- trunk/src/kash/trap.c	(revision 3434)
+++ trunk/src/kash/trap.c	(revision 3435)
@@ -187,5 +187,5 @@
 
 		if (signo != 0)
-			setsignal(psh, signo, 0);
+			setsignal(psh, signo);
 		INTON;
 		ap++;
@@ -203,5 +203,5 @@
 
 void
-clear_traps(shinstance *psh, int vforked)
+clear_traps(shinstance *psh)
 {
 	char **tp;
@@ -210,10 +210,8 @@
 		if (*tp && **tp) {	/* trap not NULL or SIG_IGN */
 			INTOFF;
-			if (!vforked) {
-				ckfree(psh, *tp);
-				*tp = NULL;
-			}
+                        ckfree(psh, *tp);
+                        *tp = NULL;
 			if (tp != &psh->trap[0])
-				setsignal(psh, (int)(tp - psh->trap), vforked);
+				setsignal(psh, (int)(tp - psh->trap));
 			INTON;
 		}
@@ -229,5 +227,5 @@
 
 void
-setsignal(shinstance *psh, int signo, int vforked)
+setsignal(shinstance *psh, int signo)
 {
 	int action;
@@ -241,5 +239,5 @@
 	else
 		action = S_IGN;
-	if (psh->rootshell && !vforked && action == S_DFL) {
+	if (psh->rootshell && action == S_DFL) {
 		switch (signo) {
 		case SIGINT:
@@ -298,6 +296,5 @@
 		case S_IGN:	sigact = SH_SIG_IGN;	break;
 	}
-	if (!vforked)
-		*t = action;
+        *t = action;
 	sh_siginterrupt(psh, signo, 1);
 	sh_signal(psh, signo, sigact);
@@ -323,11 +320,10 @@
 
 void
-ignoresig(shinstance *psh, int signo, int vforked)
+ignoresig(shinstance *psh, int signo)
 {
 	if (psh->sigmode[signo - 1] != S_IGN && psh->sigmode[signo - 1] != S_HARD_IGN) {
 		sh_signal(psh, signo, SH_SIG_IGN);
 	}
-	if (!vforked)
-		psh->sigmode[signo - 1] = S_HARD_IGN;
+	psh->sigmode[signo - 1] = S_HARD_IGN;
 }
 
@@ -340,5 +336,5 @@
 	char *sm;
 
-	clear_traps(psh, 0);
+	clear_traps(psh);
 	for (sm = psh->sigmode ; sm < psh->sigmode + NSIG ; sm++) {
 		if (*sm == S_IGN)
@@ -409,7 +405,7 @@
 	if (on == is_interactive)
 		return;
-	setsignal(psh, SIGINT, 0);
-	setsignal(psh, SIGQUIT, 0);
-	setsignal(psh, SIGTERM, 0);
+	setsignal(psh, SIGINT);
+	setsignal(psh, SIGQUIT);
+	setsignal(psh, SIGTERM);
 	is_interactive = on;
 }
Index: trunk/src/kash/trap.h
===================================================================
--- trunk/src/kash/trap.h	(revision 3434)
+++ trunk/src/kash/trap.h	(revision 3435)
@@ -38,7 +38,7 @@
 
 int trapcmd(struct shinstance *, int, char **);
-void clear_traps(struct shinstance *, int);
-void setsignal(struct shinstance *, int, int);
-void ignoresig(struct shinstance *, int, int);
+void clear_traps(struct shinstance *);
+void setsignal(struct shinstance *, int);
+void ignoresig(struct shinstance *, int);
 void onsig(struct shinstance *, int);
 void dotrap(struct shinstance *);
