Improve quality of INFO messages

This commit is contained in:
Thomas Orozco 2015-02-22 22:44:22 -08:00
parent 4431a9f897
commit 95dc316dc7
1 changed files with 3 additions and 3 deletions

6
tini.c
View File

@ -150,16 +150,16 @@ int main(int argc, char *argv[]) {
if (current_pid == child_pid) {
if (WIFEXITED(current_status)) {
/* 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);
} else if (WIFSIGNALED(current_status)) {
/* Our process was terminated. Emulate what sh / bash
* 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);
} else {
PRINT_WARNING("Main child exited for unknown reason");
PRINT_FATAL("Main child exited for unknown reason!");
return 1;
}
}