On 09/26/2014 05:05 PM, Pádraig Brady wrote:
Subject: [PATCH] dd: use more robust SIGUSR handling
s/USR/USR1/
* src/dd.c (ifd_reopen): A new wrapper to ensure we don't exit upon receiving a SIGUSR1 in a blocking open() on a fifo for example. (iread): Process signals also after a short read. (install_signal_handlers): Install SIGINFO/SIGUSR1 handler even if set to SIG_IGN, as this is what the parent can easily set from a shell script that can send SIGUSR1 without the possiblity of inadvertently killing the dd process. * doc/corutils.texi (dd invocation): Improve the example to show robust usage wrt signal races and short reads. * tests/dd/stats.sh: A new test for various signal races. * tests/local.mk: Reference the new test. * NEWS: Mention the fix.
Another minor nit: s/corutils/coreutils/ The rest LGTM. What about adding "trap '' USR1;" to usage(), too? You know, many folks are only reading that instead of the texinfo manual. OTOH, that stats-on-signal feature is such a detail that it may be worth removing from the manpage at all. Thanks & have a nice day, Berny
