]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stdio-bridge: tweak getopt() case statement a bit
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Mar 2019 12:03:49 +0000 (13:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Mar 2019 14:29:44 +0000 (15:29 +0100)
src/stdio-bridge/stdio-bridge.c

index 8022d3e5963b378999d793b877cc8c96dd8b7145..323191def6eb24a7430d62483a7887c13f013082 100644 (file)
@@ -62,26 +62,23 @@ static int parse_argv(int argc, char *argv[]) {
                 switch (c) {
 
                 case 'h':
-                        help();
-                        return 0;
+                        return help();
 
                 case ARG_VERSION:
                         return version();
 
-                case '?':
-                        return -EINVAL;
-
                 case 'p':
                         arg_bus_path = optarg;
-
                         break;
 
                 case 'M':
                         arg_bus_path = optarg;
-
                         arg_transport = BUS_TRANSPORT_MACHINE;
-
                         break;
+
+                case '?':
+                        return -EINVAL;
+
                 default:
                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                                "Unknown option code %c", c);