signals: require and always use sigaction()

tftpd already requires sigaction() to compile, so there is no reason
to use anything else. It also allows for nicer combination of flags.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2024-06-10 14:36:28 -07:00
parent e52af4207a
commit 33051a296c
6 changed files with 22 additions and 55 deletions

View file

@ -305,7 +305,7 @@ int main(int argc, char *argv[])
sp->s_proto = (char *)"udp";
}
tftp_signal(SIGINT, intr);
tftp_signal(SIGINT, intr, 0);
if (peerargc) {
/* Set peer */
@ -768,8 +768,8 @@ void intr(int sig)
{
(void)sig; /* Quiet unused warning */
tftp_signal(SIGALRM, SIG_IGN);
alarm(0);
tftp_signal(SIGALRM, SIG_DFL, 0);
siglongjmp(toplevel, -1);
}