chiark / gitweb /
util: return exit status in wait_for_terminate_and_warn()
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 01:33:51 +0000 (02:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 02:12:25 +0000 (03:12 +0100)
src/quotacheck.c
src/util.c

index 55c2f0c..da2da3b 100644 (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;
index ee6217d..b2baa1b 100644 (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);