Re: wait with trap SIGCHLD: different behaviour in 3.2 and 4.0
From:
Chet Ramey
Subject:
Re: wait with trap SIGCHLD: different behaviour in 3.2 and 4.0
Date:
Sun, 27 Sep 2009 23:06:43 -0400
User-agent:
Thunderbird 2.0.0.23 (Macintosh/20090812)
powerman@powerman.name wrote:
> Bash Version: 4.0
> Patch Level: 28
> Release Status: release
>
> Description:
> Looks like 'wait' command in bash-4 is broken: if used together
> with 'trap myhandler SIGCHLD' the 'wait' (without params) exit
> just after receiving first child exit, instead of waiting for all
> childs exit.
Posix requires this behavior.
"When the shell is waiting, by means of the wait utility, for asynchronous
commands to complete, the reception of a signal for which a trap has been
set shall cause the wait utility to return immediately with an exit status
>128, immediately after which the trap associated with that signal shall be
taken."
This was reported as a bug against bash-3.2.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/