Recently I found some code which uses signal
:
286 static void sighandler( int signum )
287 {
288 alarmed = 1;
289 signal( signum,
(1) Calling signal
two or more times is not unusual. It's just setting up two handlers for 2 different signals.
(2) Older unix systems used to reset a signals disposition to default after a handler was invoked. This code is reestablishing the handler.
The GNU man (2) signal page has a couple of paragraphs devoted to this in the "portability" section. Actually one of several reasons to use sigaction
.