* SUCH DAMAGE.
*
* @(#)eval.c 8.9 (Berkeley) 6/8/95
- * $FreeBSD: src/bin/sh/eval.c,v 1.111 2011/06/17 13:03:49 jilles Exp $
+ * $FreeBSD: src/bin/sh/eval.c,v 1.112 2011/06/18 23:58:59 jilles Exp $
*/
#include <sys/time.h>
}
/* Fork off a child process if necessary. */
- if (cmd->ncmd.backgnd
- || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
+ if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
&& ((flags & EV_EXIT) == 0 || have_traps()))
|| ((flags & EV_BACKCMD) != 0
&& (cmdentry.cmdtype != CMDBUILTIN ||
!safe_builtin(cmdentry.u.index, argc, argv)))) {
jp = makejob(cmd, 1);
- mode = cmd->ncmd.backgnd;
+ mode = FORK_FG;
if (flags & EV_BACKCMD) {
mode = FORK_NOJOB;
if (pipe(pip) < 0)
backcmd->fd = pip[0];
close(pip[1]);
backcmd->jp = jp;
- } else
- exitstatus = 0;
+ }
out:
if (lastarg)
# SUCH DAMAGE.
#
# @(#)nodetypes 8.2 (Berkeley) 5/4/95
-# $FreeBSD: src/bin/sh/nodetypes,v 1.11 2011/06/17 13:03:49 jilles Exp $
+# $FreeBSD: src/bin/sh/nodetypes,v 1.12 2011/06/18 23:58:59 jilles Exp $
# This file describes the nodes used in parse trees. Unindented lines
# contain a node type followed by a structure tag. Subsequent indented
NCMD ncmd # a simple command
type int
- backgnd int # set to run command in background
args nodeptr # the arguments
redirect nodeptr # list of file redirections
* SUCH DAMAGE.
*
* @(#)parser.c 8.7 (Berkeley) 5/16/95
- * $FreeBSD: src/bin/sh/parser.c,v 1.114 2011/06/17 13:03:49 jilles Exp $
+ * $FreeBSD: src/bin/sh/parser.c,v 1.115 2011/06/18 23:58:59 jilles Exp $
*/
#include <stdio.h>
n2 = andor();
tok = readtoken();
if (tok == TBACKGND) {
- if (n2->type == NCMD || n2->type == NPIPE) {
- n2->ncmd.backgnd = 1;
+ if (n2->type == NPIPE) {
+ n2->npipe.backgnd = 1;
} else if (n2->type == NREDIR) {
n2->type = NBACKGND;
} else {
*rpp = NULL;
n = (union node *)stalloc(sizeof (struct ncmd));
n->type = NCMD;
- n->ncmd.backgnd = 0;
n->ncmd.args = args;
n->ncmd.redirect = redir;
return n;