My function created to handle the SIGINT signal is stuck in a constant loop. The idea is to make CTRL-C ignored by the parent process but sent to the child process (and they handle it as default). What happens is when I press CTRL-C, the signal handler function is called but gets stuck in an endless loop. The kill call is supposed to send SIGTERM to all process in the process group except for the sender process. Any help would be appreciated.
the function code is:
void intHandler(int signum) {
kill(0, SIGTERM);
}
the function call code (in main) is:
(void) sigset(SIGINT, intHandler);