As long as you don't do what R.. user says in the comments below the answer you must
use only safe functions.
http://stackoverflow.com/questions/8833394/can-exit-fail-to-terminate-process/8833602#8833602
*/
if (sigaction(SIGINT, &sigintAction, NULL) < 0) {
syslog (LOG_ERR, "SIGINT restore signal handler failed: %m");
*/
if (sigaction(SIGINT, &sigintAction, NULL) < 0) {
syslog (LOG_ERR, "SIGINT restore signal handler failed: %m");
+ /* man 7 signal
+ * Async-signal-safe functions
+ * A signal handler function must be very careful, since processing elsewhere may be interrupted at some arbitrary
+ * point in the execution of the program. POSIX has the concept of "safe function". If a signal interrupts the
+ * execution of an unsafe function, and handler calls an unsafe function, then the behavior of the program is undefined.
+ *
+ * From sig handler I MAY USE JUST _exit
+ */
+ _exit (EXIT_FAILURE);
}
kill(getpid(), SIGINT);
}
}
kill(getpid(), SIGINT);
}