summaryrefslogtreecommitdiffstats
path: root/bin/sh/eval.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-18 23:58:59 +0000
committerjilles <jilles@FreeBSD.org>2011-06-18 23:58:59 +0000
commitf78ebc168ba76cc9de70590c71fceac20b9d63b8 (patch)
tree203de2f5972056cab9e1245f24b6d07cbb27e265 /bin/sh/eval.c
parenta380f591f1e9bc535b187c9602563f4fb3d543a1 (diff)
downloadFreeBSD-src-f78ebc168ba76cc9de70590c71fceac20b9d63b8.zip
FreeBSD-src-f78ebc168ba76cc9de70590c71fceac20b9d63b8.tar.gz
sh: Remove special support for background simple commands.
It expands the arguments in the parent shell process, which is incorrect.
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r--bin/sh/eval.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index a22d4b1..d5da7d3 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)
OpenPOWER on IntegriCloud