diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-02 14:25:06 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-02 17:12:23 +0200 |
commit | e9d9d50cefaae3d2db6d1f9873371290de2c7c36 (patch) | |
tree | 5986d4067df57343e64d811a1cb1a59813aac9e3 /src/initctl/initctl.c | |
parent | update-utmp,initctl: drop ppid check (diff) | |
download | systemd-e9d9d50cefaae3d2db6d1f9873371290de2c7c36.tar.xz systemd-e9d9d50cefaae3d2db6d1f9873371290de2c7c36.zip |
initctl,update-utmp: define iterator variable in loop
Diffstat (limited to 'src/initctl/initctl.c')
-rw-r--r-- | src/initctl/initctl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c index 7b93de0d8a..8e61572626 100644 --- a/src/initctl/initctl.c +++ b/src/initctl/initctl.c @@ -68,11 +68,9 @@ static const char *translate_runlevel(int runlevel, bool *isolate) { { '6', SPECIAL_REBOOT_TARGET, false }, }; - unsigned i; - assert(isolate); - for (i = 0; i < ELEMENTSOF(table); i++) + for (size_t i = 0; i < ELEMENTSOF(table); i++) if (table[i].runlevel == runlevel) { *isolate = table[i].isolate; if (runlevel == '6' && kexec_loaded()) @@ -241,7 +239,6 @@ static void server_done(Server *s) { static int server_init(Server *s, unsigned n_sockets) { int r; - unsigned i; assert(s); assert(n_sockets > 0); @@ -256,7 +253,7 @@ static int server_init(Server *s, unsigned n_sockets) { goto fail; } - for (i = 0; i < n_sockets; i++) { + for (unsigned i = 0; i < n_sockets; i++) { Fifo *f; int fd; |