[PATCH] ash: clear NONBLOCK flag from stdin when in foreground
Harald Becker
ralda at gmx.de
Fri Aug 19 15:17:52 UTC 2011
Hallo Rich!
> sigfillset(&set);
> sigprocmask(SIG_BLOCK, &set, 0);
> sigemptyset(&set);
> sigaddset(&set, SIGTERM); /* and any others I want to handle */
> sigprocmask(SIG_UNBLOCK, &set, 0);
>
> This is a lot more robust.
Robust yes ... such robust that it disables also fatal signals which may
lead to disastrous results, as such situations will no more terminate
the process and may continue running into possibly indeterminable
states!! ... think of illegal instruction traps and others.
I do not want to participate in the hollow war here, but the code
fragment above is one of those I really hate. I even had to live with
watching on how people got wounded because of such a disastrous
situation originating in a colleges comparable programming :-(
--
Harald
More information about the busybox
mailing list