check return value of sighandler

This commit is contained in:
Alessandro Mauri 2021-02-27 20:07:48 +01:00
parent 29bc56fc36
commit eb8eec916f

10
hkd.c
View File

@ -175,9 +175,13 @@ int main (int argc, char *argv[])
dead = 0;
memset(&action, 0, sizeof(action));
action.sa_handler = int_handler;
sigaction(SIGINT, &action, NULL);
sigaction(SIGUSR1, &action, NULL);
sigaction(SIGCHLD, &action, NULL);
if (sigaction(SIGINT, &action, NULL) == -1)
die(wrap_err("Error setting interrupt handler:"));
if (sigaction(SIGUSR1, &action, NULL) == -1)
die(wrap_err("Error setting interrupt handler:"));
if (sigaction(SIGCHLD, &action, NULL) == -1)
die(wrap_err("Error setting interrupt handler:"));
/* Parse config file */
parse_config_file();