aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2011-06-18 23:58:59 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2011-06-18 23:58:59 +0000
commit47e5204ee3f8a3d57fcb01ece2c4388bf125d417 (patch)
tree203de2f5972056cab9e1245f24b6d07cbb27e265 /bin
parent54b16435b7b8780422d7e032f32a74843e1b9997 (diff)
downloadsrc-47e5204ee3f8a3d57fcb01ece2c4388bf125d417.tar.gz
src-47e5204ee3f8a3d57fcb01ece2c4388bf125d417.zip
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/eval.c8
-rw-r--r--bin/sh/nodetypes1
-rw-r--r--bin/sh/parser.c5
3 files changed, 5 insertions, 9 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index a22d4b17ed33..d5da7d3022c3 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -894,14 +894,13 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
}
/* 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)
@@ -1068,8 +1067,7 @@ parent: /* parent process gets here (if we forked) */
backcmd->fd = pip[0];
close(pip[1]);
backcmd->jp = jp;
- } else
- exitstatus = 0;
+ }
out:
if (lastarg)
diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes
index f705827b910a..ae4bc4a2bd25 100644
--- a/bin/sh/nodetypes
+++ b/bin/sh/nodetypes
@@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated by a semicolon
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
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 61be512aa332..ef1aa360abbb 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -240,8 +240,8 @@ list(int nlflag, int erflag)
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 {
@@ -689,7 +689,6 @@ simplecmd(union node **rpp, union node *redir)
*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;