]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/ac-power/ac-power.c
Merge pull request #17549 from yuwata/tiny-fixes
[thirdparty/systemd.git] / src / ac-power / ac-power.c
index 2d8cbb985feefe163a136ccef4eb2743bce63bee..9fabdb9e9f1d690adb4915a69f086cb3eb09867f 100644 (file)
@@ -1,7 +1,8 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <getopt.h>
 
+#include "main-func.h"
 #include "util.h"
 
 static bool arg_verbose = false;
@@ -55,10 +56,10 @@ static int parse_argv(int argc, char *argv[]) {
                         assert_not_reached("Unhandled option");
                 }
 
-        if (optind < argc) {
-                log_error("%s takes no arguments.", program_invocation_short_name);
-                return -EINVAL;
-        }
+        if (optind < argc)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "%s takes no arguments.",
+                                       program_invocation_short_name);
 
         return 1;
 }