Child exit generates read events

Marc Lehmann schmorp at schmorp.de
Sat Aug 8 19:05:56 CEST 2009


On Sat, Aug 08, 2009 at 01:59:21PM -0300, Andre Nathan <andre at digirati.com.br> wrote:
> After the child process exits, the callback for readable events on the
> parent socket keeps being called. Is there anything I can do to avoid
> that?

sure, just stop the watcher?

note, however, that I can't see your child exiting - did you forget to
call exit() or return? both parent and child will call ev_loop after starting
a watcher.

you also never call ev_fork - this is required after a fork if you want to
continue event handling in the child and parent.

but the answer is still to stop the watcher on end-of-file, or before, or
after, or anytime, when you do not want those events anymore.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list