diff options
-rw-r--r-- | bin/sh/eval.c | 9 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/bg1.0 | 3 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/bg2.0 | 5 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/bg3.0 | 5 |
4 files changed, 19 insertions, 3 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 6f89041..b0ee28e 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -420,7 +420,8 @@ evalsubshell(union node *n, int flags) INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; - } + } else + exitstatus = 0; } @@ -559,7 +560,8 @@ evalpipe(union node *n) exitstatus = waitforjob(jp, (int *)NULL); TRACE(("evalpipe: job done exit status %d\n", exitstatus)); INTON; - } + } else + exitstatus = 0; } @@ -1056,7 +1058,8 @@ 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/tools/regression/bin/sh/execution/bg1.0 b/tools/regression/bin/sh/execution/bg1.0 new file mode 100644 index 0000000..edb92ae --- /dev/null +++ b/tools/regression/bin/sh/execution/bg1.0 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +: `false` & diff --git a/tools/regression/bin/sh/execution/bg2.0 b/tools/regression/bin/sh/execution/bg2.0 new file mode 100644 index 0000000..2e2fbc5 --- /dev/null +++ b/tools/regression/bin/sh/execution/bg2.0 @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 42; } +f +: | : & diff --git a/tools/regression/bin/sh/execution/bg3.0 b/tools/regression/bin/sh/execution/bg3.0 new file mode 100644 index 0000000..359fc6f --- /dev/null +++ b/tools/regression/bin/sh/execution/bg3.0 @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 42; } +f +(:) & |