OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: [OT OBSD Programming] kill cu processes

From: Todd C. Miller (Todd.Millercourtesan.com)
Date: Wed Sep 01 2004 - 13:31:48 CDT


In message <413580F5.9050302krachstoff.net>
        so spake =?ISO-8859-1?Q?Christian_Sch=E4fer?= (caefer):

> this is no problem until we want to exit.
> how can our programm, that has done the fork() of cu, kill _both_ cu
> processes. right now the self-forked cu process remains as a zombie. we
> don't want this of course..

If it is a zombie that means you need to wait(2) for it. A simple
SIGCHLD handler that does waitpid() should be sufficient. Or,
better yet, just set a flag in the signal handler and so the waiting
in the main process body.

 - todd