… | |
… | |
727 | int pid, status; |
727 | int pid, status; |
728 | |
728 | |
729 | if (0 < (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED))) |
729 | if (0 < (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED))) |
730 | { |
730 | { |
731 | /* make sure we are called again until all childs have been reaped */ |
731 | /* make sure we are called again until all childs have been reaped */ |
|
|
732 | /* we need to do it this way so that the callback gets called before we continue */ |
732 | ev_feed_event (EV_A_ (W)sw, EV_SIGNAL); |
733 | ev_feed_event (EV_A_ (W)sw, EV_SIGNAL); |
733 | |
734 | |
734 | child_reap (EV_A_ sw, pid, pid, status); |
735 | child_reap (EV_A_ sw, pid, pid, status); |
735 | child_reap (EV_A_ sw, 0, pid, status); /* this might trigger a watcher twice, but event catches that */ |
736 | child_reap (EV_A_ sw, 0, pid, status); /* this might trigger a watcher twice, but feed_event catches that */ |
736 | } |
737 | } |
737 | } |
738 | } |
738 | |
739 | |
739 | #endif |
740 | #endif |
740 | |
741 | |