mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
Minor, add debug logs and clarify comment
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3069e753e1
commit
6da8af8136
2 files changed
+5
-4
No files matched your search
+4
-4
@@ -59,11 +59,11 @@ int complete(char *cmd, int pid)
|
||||
|
||||
if (waitpid(pid, &status, 0) == -1) {
|
||||
if (errno == EINTR)
|
||||
errx(1, "Caught unblocked signal waiting for %s, aborting", cmd);
|
||||
warnx("Caught unblocked signal waiting for %s, aborting", cmd);
|
||||
else if (errno == ECHILD)
|
||||
errx(1, "Caught SIGCHLD waiting for %s, aborting", cmd);
|
||||
warnx("Caught SIGCHLD waiting for %s, aborting", cmd);
|
||||
else
|
||||
errx(1, "Failed starting %s, error %d: %s", cmd, errno, strerror (errno));
|
||||
warnx("Failed starting %s, error %d: %s", cmd, errno, strerror(errno));
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ int run(char *cmd, char *log)
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
dbg("Process '%s' terminated by signal %d", cmd, WTERMSIG(status));
|
||||
if (!result)
|
||||
result = 1; /* Must alert callee that the command did complete successfully.
|
||||
result = 1; /* Must alert callee the command did not complete successfully.
|
||||
* This is necessary since not all programs trap signals and
|
||||
* change their return code accordingly. --Jocke */
|
||||
}
|
||||
|
||||
@@ -652,6 +652,7 @@ static int service_start(svc_t *svc)
|
||||
goto fail;
|
||||
}
|
||||
if (pid > 1) {
|
||||
dbg("Starting %s as PID %d", svc_ident(svc, NULL, 0), pid);
|
||||
svc->pid = pid;
|
||||
svc->start_time = jiffies();
|
||||
} else if (pid == 0) {
|
||||
|
||||
Reference in new issue
Block a user