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
..
2011-05-13 16:29:57 +00:00
2013-03-15 20:12:54 +00:00
2012-02-22 03:36:15 +00:00
2013-10-01 18:41:53 +00:00
2013-06-29 15:49:26 +00:00
2013-10-11 20:10:18 +00:00
2013-04-28 22:52:43 +00:00
2013-06-02 17:55:00 +00:00
2013-04-27 21:59:43 +00:00
2013-04-26 17:56:35 +00:00
2010-02-15 14:07:40 +00:00
2013-03-15 20:12:54 +00:00
2012-07-15 21:12:22 +00:00