checkpatch: should not use signal except for SIG_DFL or SIG_IGN
commite8c2091d4c4dd78bb9b8618205a238b96c87045d
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 4 Jul 2017 09:26:37 +0000 (4 11:26 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 4 Jul 2017 12:39:28 +0000 (4 14:39 +0200)
treed405300af3eb11fad1a2c37e2b1fcd16ab13f7d7
parentde5f852f38d644edf995a810c34b4d24dbfbd740
checkpatch: should not use signal except for SIG_DFL or SIG_IGN

Using signal to establish a signal handler is not portable; on
SysV systems, the signal handler would be reset to SIG_DFL after
delivery, while BSD preserves the signal handler.  Daniel Berrange
reported that (to complicate matters further) the signal system call
has SysV behavior, but glibc signal() actually calls the sigaction
system call to provide BSD behavior.

However, using signal() to set a signal's disposition to SIG_DFL
or SIG_IGN is portable and is a relatively common occurrence in
QEMU source code, so allow that.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl