From 0a27cf3f32403f48059396cb43ad25d0a12ef64b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Mar 2011 02:33:51 +0100 Subject: [PATCH] util: return exit status in wait_for_terminate_and_warn() --- src/quotacheck.c | 2 +- src/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quotacheck.c b/src/quotacheck.c index 55c2f0c6..da2da3b2 100644 --- a/src/quotacheck.c +++ b/src/quotacheck.c @@ -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; diff --git a/src/util.c b/src/util.c index ee6217d6..b2baa1ba 100644 --- a/src/util.c +++ b/src/util.c @@ -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); -- 2.39.5