You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
486 B
25 lines
486 B
#include <signal.h> /* for signal() and signal names */
|
|
|
|
volatile int doShutdown;
|
|
|
|
void terminate(int signum)
|
|
{
|
|
signal(signum, SIG_IGN);
|
|
/*
|
|
* @TODO do logging here
|
|
*/
|
|
doShutdown = 1;
|
|
}
|
|
|
|
void init_signals(void)
|
|
{
|
|
signal(SIGTERM, terminate);
|
|
signal(SIGHUP, SIG_IGN);
|
|
signal(SIGINT, terminate);
|
|
signal(SIGQUIT, terminate);
|
|
signal(SIGABRT, terminate);
|
|
signal(SIGALRM, SIG_IGN);
|
|
signal(SIGURG, SIG_IGN);
|
|
|
|
signal(SIGPIPE, SIG_IGN);
|
|
}
|