server 0.0.1
basicserverinfrastructure

src/signalHandling.c

Go to the documentation of this file.
00001 #include <signal.h>     /* for signal() and signal names */
00002 
00003 volatile int doShutdown;
00004 
00005 void terminate(int signum)
00006 {
00007     signal(signum, SIG_IGN);
00008     /*
00009      * @TODO do logging here
00010      */
00011     doShutdown = 1;
00012 }
00013 
00014 void init_signals(void)
00015 {
00016     signal(SIGTERM, terminate);
00017     signal(SIGHUP, SIG_IGN);
00018     signal(SIGINT, terminate);
00019     signal(SIGQUIT, terminate);
00020     signal(SIGABRT, terminate);
00021     signal(SIGALRM, SIG_IGN);
00022     signal(SIGURG, SIG_IGN);
00023 
00024     signal(SIGPIPE, SIG_IGN);
00025 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines