jilles 0df7adbcbe sh: Fix EINTR race condition in "wait" and "set -T" using sigsuspend().
When waiting for child processes using "wait" or if "set -T" is in effect, a
signal interrupts the wait. Make sure there is no window where the signal
handler may be invoked (setting a flag) just before going to sleep.

There is a similar race condition in the shell language, but scripts can
avoid it by exiting from the trap handler or enforcing synchronization using
a fifo.

If SIGCHLD is not trapped, a signal handler must be installed for it. Only
install this handler for the duration of the wait to avoid triggering
unexpected [EINTR] errors elsewhere.

Note that for some reason only SIGINT and SIGQUIT interrupt a "wait"
command. This remains the case.
2012-07-29 18:04:38 +00:00
..
2011-12-11 20:53:12 +00:00
2011-05-13 16:29:57 +00:00
2012-02-22 03:36:15 +00:00
2009-01-30 16:23:57 +00:00
2009-06-23 23:30:56 +00:00
2012-05-12 02:49:40 +00:00
2011-02-04 16:40:50 +00:00
2010-02-15 14:07:40 +00:00
2012-07-15 21:12:22 +00:00
2012-05-13 14:16:04 +00:00
2010-09-13 01:29:51 +00:00