Jilles Tjoelker 728e552fdc sh: Don't overwrite old exit status if a PID is reused.
Only store exit status for a process if that process has not terminated yet.

Test (slow):
  exit 7 & p1=$!; until exit 8 & p2=$!; [ "$p1" = "$p2" ]; do wait "$p2";
  done; sleep 0.1; wait %1; echo $?
should write "7".
2014-03-20 22:38:13 +00:00
..
2014-03-14 21:45:37 +00:00
2014-02-26 21:38:42 +00:00
2013-07-25 15:08:41 +00:00
2013-04-07 16:28:36 +00:00
2014-03-14 21:45:37 +00:00
2014-02-25 03:05:43 +00:00
2013-07-25 19:48:15 +00:00
2013-07-25 15:08:41 +00:00