--- libev/ev.c 2008/02/09 00:34:11 1.210 +++ libev/ev.c 2008/02/19 17:09:28 1.211 @@ -813,6 +813,9 @@ ev_io_set (&pipeev, evpipe [0], EV_READ); ev_io_start (EV_A_ &pipeev); ev_unref (EV_A); /* watcher should not keep loop alive */ + + /* in case we received the signal before we had the chance of installing a handler */ + ev_feed_event (EV_A_ &pipeev, 0); } } @@ -840,7 +843,7 @@ read (evpipe [0], &dummy, 1); } - if (gotsig) + if (gotsig && ev_is_default_loop (EV_A)) { int signum; gotsig = 0;