summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl-list-unit-files.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-05 11:33:48 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-15 20:49:14 +0100
commitdeaf4b863bfab0ce1fb396fb273f716359bb0517 (patch)
tree1e4c42ca1e11a09ff231139c3fddb3fba3d086a4 /src/systemctl/systemctl-list-unit-files.c
parentcb31470f40283f4806a9fd50fb612800e99ef75d (diff)
downloadsystemd-deaf4b863bfab0ce1fb396fb273f716359bb0517.tar.gz
systemctl: reduce scope of iterator variables
Diffstat (limited to 'src/systemctl/systemctl-list-unit-files.c')
-rw-r--r--src/systemctl/systemctl-list-unit-files.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/systemctl/systemctl-list-unit-files.c b/src/systemctl/systemctl-list-unit-files.c
index e1bf876620..6da2914eff 100644
--- a/src/systemctl/systemctl-list-unit-files.c
+++ b/src/systemctl/systemctl-list-unit-files.c
@@ -136,7 +136,6 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) {
int list_unit_files(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_free_ UnitFileList *units = NULL;
- UnitFileList *unit;
size_t size = 0;
unsigned c = 0;
const char *state;
@@ -265,7 +264,7 @@ int list_unit_files(int argc, char *argv[], void *userdata) {
return r;
if (install_client_side())
- for (unit = units; unit < units + c; unit++)
+ for (UnitFileList *unit = units; unit < units + c; unit++)
free(unit->path);
if (c == 0)