sh: Set $? to 0 for background commands.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sat, 2 Jul 2011 23:59:09 +0000 (13:59 -1000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 21 Aug 2011 19:10:24 +0000 (12:10 -0700)
commit5d4731c8351e78f0e4bf4cc5b6997b92110c3fbd
tree1e3f186e1c85c6b6133d8f79ff0b198793c9470b
parent1bf9817349b98799b92b1e764d4d0855695ce4ea
sh: Set $? to 0 for background commands.

For backgrounded pipelines and subshells, the previous value of $? was
being preserved, which is incorrect.

For backgrounded simple commands containing a command substitution, the
status of the last command substitution was returned instead of 0.

If fork() fails, this is an error.

Obtained-from:   FreeBSD SVN rev 221027
bin/sh/eval.c
tools/regression/bin/sh/execution/bg1.0 [new file with mode: 0644]
tools/regression/bin/sh/execution/bg2.0 [new file with mode: 0644]
tools/regression/bin/sh/execution/bg3.0 [new file with mode: 0644]