]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: shorten code a bit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Jul 2022 21:20:03 +0000 (06:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 8 Jul 2022 18:37:43 +0000 (03:37 +0900)
src/core/dbus-cgroup.c

index 7e95f0e39077b780c568da22252cc53bc6babb6e..4fc4fb0021612b1604e1059902a25a8d747bc6a2 100644 (file)
@@ -1439,12 +1439,11 @@ int bus_cgroup_set_property(
 
         } else if (STR_IN_SET(name, "BlockIOReadBandwidth", "BlockIOWriteBandwidth")) {
                 const char *path;
-                bool read = true;
                 unsigned n = 0;
                 uint64_t u64;
+                bool read;
 
-                if (streq(name, "BlockIOWriteBandwidth"))
-                        read = false;
+                read = streq(name, "BlockIOReadBandwidth");
 
                 r = sd_bus_message_enter_container(message, 'a', "(st)");
                 if (r < 0)