1 #include "handleSignal.h"
6 /// ***** Private Method Headers *****
8 void sighandler( int sig );
10 /// ***** Public Methods *****
14 // register signal handler
16 sigemptyset( &sa.sa_mask );
17 sa.sa_handler = sighandler;
20 if ( sigaction( SIGINT, &sa, NULL ) < 0 )
22 std::cerr << "could not install SIGINT handler" << std::endl;
26 /// ***** Private Methods *****
28 // signal handler function
29 void sighandler( int sig )
34 std::cerr << "SIGINT caught" << std::endl;
37 std::cout << "UNKNOWN caught";
40 // normally an abort is better ... but this is just SIGINT