diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-08 11:58:29 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-08 12:14:05 +0200 |
commit | 90e74a66e663f1776457d599cb7d5ce44785a56c (patch) | |
tree | 16ce28594b8dc475e37df9a3b80accb96e748efa /src/sysv-generator | |
parent | core/unit: reduce scope of variables (diff) | |
download | systemd-90e74a66e663f1776457d599cb7d5ce44785a56c.tar.xz systemd-90e74a66e663f1776457d599cb7d5ce44785a56c.zip |
tree-wide: define iterator inside of the macro
Diffstat (limited to 'src/sysv-generator')
-rw-r--r-- | src/sysv-generator/sysv-generator.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index a2c72d1009..7d6be31742 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -655,7 +655,6 @@ static int load_sysv(SysvStub *s) { static int fix_order(SysvStub *s, Hashmap *all_services) { SysvStub *other; - Iterator j; int r; assert(s); @@ -666,7 +665,7 @@ static int fix_order(SysvStub *s, Hashmap *all_services) { if (s->sysv_start_priority < 0) return 0; - HASHMAP_FOREACH(other, all_services, j) { + HASHMAP_FOREACH(other, all_services) { if (s == other) continue; @@ -817,7 +816,6 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic Set *runlevel_services[ELEMENTSOF(rcnd_table)] = {}; _cleanup_strv_free_ char **sysvrcnd_path = NULL; SysvStub *service; - Iterator j; char **p; int r; @@ -892,7 +890,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic } for (unsigned i = 0; i < ELEMENTSOF(rcnd_table); i++) - SET_FOREACH(service, runlevel_services[i], j) { + SET_FOREACH(service, runlevel_services[i]) { r = strv_extend(&service->before, rcnd_table[i].target); if (r < 0) { log_oom(); @@ -918,7 +916,6 @@ static int run(const char *dest, const char *dest_early, const char *dest_late) _cleanup_(free_sysvstub_hashmapp) Hashmap *all_services = NULL; _cleanup_(lookup_paths_free) LookupPaths lp = {}; SysvStub *service; - Iterator j; int r; assert_se(arg_dest = dest_late); @@ -939,10 +936,10 @@ static int run(const char *dest, const char *dest_early, const char *dest_late) if (r < 0) return r; - HASHMAP_FOREACH(service, all_services, j) + HASHMAP_FOREACH(service, all_services) (void) load_sysv(service); - HASHMAP_FOREACH(service, all_services, j) { + HASHMAP_FOREACH(service, all_services) { (void) fix_order(service, all_services); (void) generate_unit_file(service); } |