]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
validatefs: do not use EXIT_* in run()
authorMike Yuan <me@yhndnzj.com>
Mon, 31 Mar 2025 16:43:34 +0000 (18:43 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 31 Mar 2025 17:23:50 +0000 (19:23 +0200)
The plain DEFINE_MAIN_FUNCTION is used, i.e. all >= 0 retvals
are treated as success. No need for EXIT_* annotations.

src/validatefs/validatefs.c

index 8e7753126c7aee6781b2acee9a57aec23a6dcfc6..22345e5303ef3bc31a882088d50c914c53446615 100644 (file)
@@ -318,14 +318,10 @@ static int run(int argc, char *argv[]) {
                 return r;
         if (r == 0) {
                 log_info("File system '%s' has no validation constraints set, not validating.", resolved);
-                return EXIT_SUCCESS;
+                return 0;
         }
 
-        r = validate_fields_check(target_fd, resolved, &f);
-        if (r < 0)
-                return r;
-
-        return EXIT_SUCCESS;
+        return validate_fields_check(target_fd, resolved, &f);
 }
 
 DEFINE_MAIN_FUNCTION(run);