diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-27 08:19:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 08:19:39 +0100 |
commit | fe96c0f86d15e844d74d539c6cff7f971078cf84 (patch) | |
tree | cb4f1a6248826c163b766c1be5d82d882f9fbb28 /src/core/dbus-manager.c | |
parent | 37baf8db563f085e8867a0764f9832dcd7e94605 (diff) | |
download | systemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.tar.gz |
treewide: tighten variable scope in loops (#18372)
Also use _cleanup_free_ in one more place.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r-- | src/core/dbus-manager.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index eeb74353da..9053d48149 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -1951,10 +1951,9 @@ static int install_error( UnitFileChange *changes, size_t n_changes) { - size_t i; int r; - for (i = 0; i < n_changes; i++) + for (size_t i = 0; i < n_changes; i++) switch(changes[i].type) { @@ -2021,7 +2020,6 @@ static int reply_unit_file_changes_and_free( _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; bool bad = false, good = false; - size_t i; int r; if (unit_file_changes_have_modification(changes, n_changes)) { @@ -2044,7 +2042,7 @@ static int reply_unit_file_changes_and_free( if (r < 0) goto fail; - for (i = 0; i < n_changes; i++) { + for (size_t i = 0; i < n_changes; i++) { if (changes[i].type < 0) { bad = true; |