Bug with signal delivery after fork.

Marc Lehmann schmorp at schmorp.de
Wed Jan 16 03:48:52 CET 2008


On Tue, Jan 15, 2008 at 12:54:59PM -0500, Chris Shoemaker <c.shoemaker at cox.net> wrote:
> I've narrowed this down considerably by tracing both good and bad
> executions and comparing.  I'll comment the differences in the code:

Your test program is still buggy:

>     ev_default_fork();
>     ev_loop(loop, EVLOOP_NONBLOCK);
>     ev_signal_init (&signal_watcher, signal_cb, SIGHUP);
>     ev_signal_start (loop, &signal_watcher);

You have to start your watcher before looping, otherwise it does return when
no other watchers are active.

-- 
                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