[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash: sleep execution issue with bash loadable builtins

From: Chet Ramey
Subject: Re: Bash: sleep execution issue with bash loadable builtins
Date: Tue, 28 Nov 2017 09:39:02 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 11/28/17 12:17 AM, Thiruvadi Rajaraman wrote:
> Hi,
> Thanks a lot for your review comments.
> I have reworked on the bash sleep fix based on your suggestion about signal
> and trap handling in fsleep( ).
> I have attached the fix patch for your kind reference.

Your patch unconditionally changes the SIGCHLD signal handler to an invalid
value (you probably meant to use SIG_IGN) without restoring it. An
interactive shell would not be able to use job control until something
internal reset the SIGCHLD handler to the correct value.

An approach that uses pselect() if available and blocks SIGCHLD for the
duration of the call, as Angel suggested, is probably the best approach.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]