]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/systemctl/systemctl-is-active.c
systemctl: reduce scope of iterator variables
[thirdparty/systemd.git] / src / systemctl / systemctl-is-active.c
index 3d99b0deb60f2b6411bc1654ed32cfa3010e9fdd..d83736e94aa22dd4112280e1b81c46227c22c7ea 100644 (file)
@@ -14,7 +14,7 @@ static int check_unit_generic(int code, const UnitActiveState good_states[], int
         UnitActiveState active_state;
         sd_bus *bus;
         char **name;
-        int r, i;
+        int r;
         bool found = false;
 
         r = acquire_bus(BUS_MANAGER, &bus);
@@ -33,7 +33,7 @@ static int check_unit_generic(int code, const UnitActiveState good_states[], int
                 if (!arg_quiet)
                         puts(unit_active_state_to_string(active_state));
 
-                for (i = 0; i < nb_states; ++i)
+                for (int i = 0; i < nb_states; ++i)
                         if (good_states[i] == active_state)
                                 found = true;
         }