mirror of https://github.com/krallin/tini.git
Improve quality of INFO messages
This commit is contained in:
parent
4431a9f897
commit
95dc316dc7
6
tini.c
6
tini.c
|
@ -150,16 +150,16 @@ int main(int argc, char *argv[]) {
|
||||||
if (current_pid == child_pid) {
|
if (current_pid == child_pid) {
|
||||||
if (WIFEXITED(current_status)) {
|
if (WIFEXITED(current_status)) {
|
||||||
/* Our process exited normally. */
|
/* Our process exited normally. */
|
||||||
PRINT_INFO("Main child exited normally (check exit status)");
|
PRINT_INFO("Main child exited normally (with status '%i')", WEXITSTATUS(current_status));
|
||||||
return WEXITSTATUS(current_status);
|
return WEXITSTATUS(current_status);
|
||||||
} else if (WIFSIGNALED(current_status)) {
|
} else if (WIFSIGNALED(current_status)) {
|
||||||
/* Our process was terminated. Emulate what sh / bash
|
/* Our process was terminated. Emulate what sh / bash
|
||||||
* would do, which is to return 128 + signal number.
|
* would do, which is to return 128 + signal number.
|
||||||
*/
|
*/
|
||||||
PRINT_INFO("Main child exited with signal");
|
PRINT_INFO("Main child exited with signal (with signal '%s')", strsignal(WTERMSIG(current_status)));
|
||||||
return 128 + WTERMSIG(current_status);
|
return 128 + WTERMSIG(current_status);
|
||||||
} else {
|
} else {
|
||||||
PRINT_WARNING("Main child exited for unknown reason");
|
PRINT_FATAL("Main child exited for unknown reason!");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue