diff --git a/src/basic/main-func.h b/src/basic/main-func.h index 6417cc822aa..24bf6c99bfa 100644 --- a/src/basic/main-func.h +++ b/src/basic/main-func.h @@ -20,8 +20,8 @@ #define DEFINE_MAIN_FUNCTION(impl) \ _DEFINE_MAIN_FUNCTION(impl, r < 0 ? EXIT_FAILURE : EXIT_SUCCESS) -/* Zero is mapped to EXIT_SUCCESS, and both negative and positive values - * are mapped to EXIT_FAILURE. - * Note: this means "true" maps to EXIT_FAILURE. */ +/* Zero is mapped to EXIT_SUCCESS, negative values are mapped to EXIT_FAILURE, + * and postive values are propagated. + * Note: "true" means failure! */ #define DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(impl) \ - _DEFINE_MAIN_FUNCTION(impl, r != 0 ? EXIT_FAILURE : EXIT_SUCCESS) + _DEFINE_MAIN_FUNCTION(impl, r < 0 ? EXIT_FAILURE : r) diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index b1ce210fcc7..995cf92ef12 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -428,7 +428,7 @@ static int run(int argc, char *argv[]) { if (exit_status & FSCK_ERROR_CORRECTED) (void) touch("/run/systemd/quotacheck"); - return exit_status & (FSCK_SYSTEM_SHOULD_REBOOT | FSCK_ERRORS_LEFT_UNCORRECTED); + return !!(exit_status & (FSCK_SYSTEM_SHOULD_REBOOT | FSCK_ERRORS_LEFT_UNCORRECTED)); } DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(run);