--- libev/ev.c 2007/11/01 15:21:13 1.38 +++ libev/ev.c 2007/11/01 17:17:32 1.39 @@ -425,7 +425,7 @@ while ((pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED)) != -1) for (w = childs [pid & (PID_HASHSIZE - 1)]; w; w = w->next) - if (w->pid == pid || w->pid == -1) + if (w->pid == pid || !w->pid) { w->status = status; event ((W)w, EV_CHILD);