On 22 May 2017 at 19:43, Denys Vlasenko <[email protected]> wrote:
>> I am not sure what is the right place to fix this. Any comment on this?
>> For me it works to suppress this signal on the corresponding poll() call.
>
> Well, SIGCHLD may have a trap, so, that would not be correct.
>
> Fixed in git, please try.
Thanks for your fix. Works perfect for my script (controlling a cellular
modem)
I was curious how to catch SIGCHLD using trap and what behavior we should
expect. Could you also provide a test for trap in conjunction with SIGCHLD.
Here my tries with results from busybox-git with your fix:
# sleep 1& read x
=> no trap signal handler installed, read waits now forever for input
# trap "echo --TRAP---" CHLD; sleep 1& read x
--TRAP---
[1]+ Done sleep 1
=> Okay, read will be interrupted after one second
(this works now thanks your fixes in signal handling coder.
It would not work correctly in busybox 1.24 versions)
# sleep 1& read x
--TRAP---
[1]+ Done sleep 1
=> Okay, trap handler still installed, same in subsequent commands
# trap '' CHLD
# sleep 1& read x
[1]+ Done sleep 1
=> Is this correct? Set SIGCHLD to ignore, read still will be
interrupted after one second.
# trap - CHLD
# sleep 1& read x
=> Okay, set SIGCHLD to default. read now waits for ever again.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox