I have been trying to prevent my parent thread from killing the child proccess if the parent proccess recives a ctrl-C signal. I have run out of ideas.
The parent proccess allready catches SIGINT and so i want the same as now the children dies.
int main() {
pid_t pid;
pid = fork();
if(pid > 0) {
/*Parent proccess*/
[...other code...]
} else {
/*Child proccess*/
signal(SIGINT, SIG_IGN); //does not work
sigaction(SIGINT, &action, 0); //does not work either
[...other code...]
}
}
Ideas?