mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00

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>
19 lines
337 B
C
19 lines
337 B
C
/*
|
|
* signal.c
|
|
*
|
|
* User-friendly wrapper around sigaction().
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
int tftp_signal(int signum, sighandler_t handler, int flags)
|
|
{
|
|
struct sigaction sa;
|
|
|
|
memset(&sa, 0, sizeof sa);
|
|
sa.sa_handler = handler;
|
|
sigemptyset(&sa.sa_mask);
|
|
sa.sa_flags = flags;
|
|
|
|
return sigaction(signum, &sa, NULL);
|
|
}
|