version 1.112, 2017/08/18 05:36:45 |
version 1.113, 2017/08/18 05:48:04 |
|
|
|
|
/* Returns 0 if pid exited cleanly, non-zero otherwise */ |
/* Returns 0 if pid exited cleanly, non-zero otherwise */ |
int |
int |
exited_cleanly(pid_t pid, const char *tag, const char *cmd) |
exited_cleanly(pid_t pid, const char *tag, const char *cmd, int quiet) |
{ |
{ |
int status; |
int status; |
|
|
|
|
error("%s %s exited on signal %d", tag, cmd, WTERMSIG(status)); |
error("%s %s exited on signal %d", tag, cmd, WTERMSIG(status)); |
return -1; |
return -1; |
} else if (WEXITSTATUS(status) != 0) { |
} else if (WEXITSTATUS(status) != 0) { |
error("%s %s failed, status %d", tag, cmd, WEXITSTATUS(status)); |
do_log2(quiet ? SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_INFO, |
|
"%s %s failed, status %d", tag, cmd, WEXITSTATUS(status)); |
return -1; |
return -1; |
} |
} |
return 0; |
return 0; |