util: return exit status in wait_for_terminate_and_warn()

This commit is contained in:
Lennart Poettering 2011-03-14 02:33:51 +01:00
parent 46824d0e6b
commit 0a27cf3f32
2 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ int main(int argc, char *argv[]) {
_exit(1); /* Operational error */
}
r = wait_for_terminate_and_warn("quotacheck", pid) >= 0 ? EXIT_SUCCESS : EXIT_FAILURE;
r = wait_for_terminate_and_warn("quotacheck", pid) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
finish:
return r;

View File

@ -3616,7 +3616,7 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid) {
if (status.si_code == CLD_EXITED) {
if (status.si_status != 0) {
log_warning("%s failed with error code %i.", name, status.si_status);
return -EPROTO;
return status.si_status;
}
log_debug("%s succeeded.", name);