It is currently Tue, 30 Nov 2021 17:18:29 GMT



 
Author Message
 Parent process also terminating after killing child process in SIGINT
I redirect the SIGINT signal then fork a new child process. I want the
sigint_handler function to kill the child when a Ctrl-C is pressed. It is
aware of the child's pid, because I make this (value fork returns) a global
variable. The problem is, in my sigint_handler func, I have kill(child_pid,
SIGTERM). For some stranger reason, my parent process is also Terminated and
the shell tells me so. However, if I put something like a cout right above
the
kill statement, only the child is killed and parent moves on with its other
functions. This is very strange and annoying to me. I just want the child to
die, not the parent too. Any ideas why this should happen and why the cout
changes the affect?

Thank you,
Chad



 Fri, 16 Jan 2004 06:11:51 GMT   
 
   [ 1 post ] 

Similar Threads

1. Parent process also terminating after killing child process in SIGINT

2. Child process terminates when parent process killed

3. how to kill a child process that runs other children processes

4. Newbie question, killing child processes along with parent

5. Help: Killing children processes but not their parents

6. Best way to quickly kill parent and all child processes

7. Terminate process without killing children

8. Child processes ALWAYS die when parent killed?

9. Child Process Waiting for Parent Process

10. child processes not dying with parent process??


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software