mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
Save process exit status to svc_t
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
225510a270
commit
c3eca9fe8f
4 files changed
+11
-6
No files matched your search
@@ -316,6 +316,7 @@ static void sigterm_cb(uev_t *w, void *arg, int events)
|
||||
static void sigchld_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
pid_t pid;
|
||||
int status;
|
||||
|
||||
if (UEV_ERROR == events) {
|
||||
_e("Unrecoverable error in signal watcher");
|
||||
@@ -324,10 +325,10 @@ static void sigchld_cb(uev_t *w, void *arg, int events)
|
||||
|
||||
/* Reap all the children! */
|
||||
do {
|
||||
pid = waitpid(-1, NULL, WNOHANG);
|
||||
pid = waitpid(-1, &status, WNOHANG);
|
||||
if (pid > 0) {
|
||||
_d("Collected child %d", pid);
|
||||
service_monitor(pid);
|
||||
service_monitor(pid, status);
|
||||
}
|
||||
} while (pid > 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user