… | |
… | |
32 | #ifdef __cplusplus |
32 | #ifdef __cplusplus |
33 | extern "C" { |
33 | extern "C" { |
34 | #endif |
34 | #endif |
35 | |
35 | |
36 | #ifndef EV_STANDALONE |
36 | #ifndef EV_STANDALONE |
|
|
37 | # ifdef EV_CONFIG_H |
|
|
38 | # include EV_CONFIG_H |
|
|
39 | # else |
37 | # include "config.h" |
40 | # include "config.h" |
|
|
41 | # endif |
38 | |
42 | |
39 | # if HAVE_CLOCK_GETTIME |
43 | # if HAVE_CLOCK_GETTIME |
40 | # ifndef EV_USE_MONOTONIC |
44 | # ifndef EV_USE_MONOTONIC |
41 | # define EV_USE_MONOTONIC 1 |
45 | # define EV_USE_MONOTONIC 1 |
42 | # endif |
46 | # endif |
… | |
… | |
727 | int pid, status; |
731 | int pid, status; |
728 | |
732 | |
729 | if (0 < (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED))) |
733 | if (0 < (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED))) |
730 | { |
734 | { |
731 | /* make sure we are called again until all childs have been reaped */ |
735 | /* make sure we are called again until all childs have been reaped */ |
|
|
736 | /* 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); |
737 | ev_feed_event (EV_A_ (W)sw, EV_SIGNAL); |
733 | |
738 | |
734 | child_reap (EV_A_ sw, pid, pid, status); |
739 | 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 */ |
740 | child_reap (EV_A_ sw, 0, pid, status); /* this might trigger a watcher twice, but feed_event catches that */ |
736 | } |
741 | } |
737 | } |
742 | } |
738 | |
743 | |
739 | #endif |
744 | #endif |
740 | |
745 | |