return parse_mode(m, ret);
}
-int wait_for_terminate(pid_t pid, siginfo_t *status) {
- siginfo_t dummy;
-
- assert(pid >= 1);
-
- if (!status)
- status = &dummy;
-
- for (;;) {
- zero(*status);
-
- if (waitid(P_PID, pid, status, WEXITED) < 0) {
-
- if (errno == EINTR)
- continue;
-
- return negative_errno();
- }
-
- return 0;
- }
+int wait_for_terminate(pid_t pid, siginfo_t *ret) {
+ return pidref_wait_for_terminate(&PIDREF_MAKE_FROM_PID(pid), ret);
}
/*
return IN_SET(code, CLD_EXITED, CLD_KILLED, CLD_DUMPED);
}
-int wait_for_terminate(pid_t pid, siginfo_t *status);
+int wait_for_terminate(pid_t pid, siginfo_t *ret);
typedef enum WaitFlags {
WAIT_LOG_ABNORMAL = 1 << 0,