]> 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 090b6b1783d409075789e7938f8e057cebbd9490..9fabdb9e9f1d690adb4915a69f086cb3eb09867f 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <getopt.h>
 
@@ -56,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;
 }