[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: |
Fri, 1 Dec 2017 11:01:43 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
On 12/1/17 7:49 AM, Thiruvadi Rajaraman wrote:
> Hi Chester,
>
> Thanks a lot for your review comments.
>
> I reworked on the fix to solve bash sleep issue and here attached the patch.
I don't think you got my point. Why would you override bash's installed
signal handler -- disabling job and process handling -- without restoring
it before the function returns? Even if changing the signal handler were
the right thing to do, which it isn't, it's just a terrible idea to change
it unconditionally. The right fix is to block SIGCHLD during the sleep,
which you can do easily using pselect.
--
``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/