#include #include #include #include #include #include "signal-helper.h" void sigint_handler(int sig) { // SIGINT handler printf("So you think you can stop the bomb with ctrl-c, do you?\n"); sleep(2); printf("Well..."); fflush(stdout); sleep(1); printf("NOPE!\n"); // exit(0); } int main() { // install the handler if (Signal(SIGINT, sigint_handler) == SIG_ERR) { unix_error("signal error"); } while (1) { // Wait for the receipt of a signal pause(); } return 0; }