]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portablectl: reorder if branches to match previous conditional in the same function
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Mar 2022 17:56:06 +0000 (18:56 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 7 Mar 2022 13:31:48 +0000 (14:31 +0100)
One is a ternary op, the other an normal conditional, but they should still use
the same order of branches.

src/portable/portablectl.c

index bc7a4ddc210d46a60590a08c58ccaa8ed3749053..7e222870bc0ddc9b3c1de377f3517d3d7b31e337 100644 (file)
@@ -928,12 +928,13 @@ static int detach_image(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        if (!strv_isempty(arg_extension_images)) {
+        if (strv_isempty(arg_extension_images))
+                r = sd_bus_message_append(m, "b", arg_runtime);
+        else {
                 uint64_t flags = arg_runtime ? PORTABLE_RUNTIME : 0;
 
                 r = sd_bus_message_append(m, "t", flags);
-        } else
-                r = sd_bus_message_append(m, "b", arg_runtime);
+        }
         if (r < 0)
                 return bus_log_create_error(r);