From de010b0b2e50cf0b3837ce350b116bc92605f67a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 16 Mar 2022 22:32:23 +0900 Subject: strv: make iterator in STRV_FOREACH() declaread in the loop This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS() --- src/sysext/sysext.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/sysext') diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 60789e0f2c..6d4df0afd2 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -124,7 +124,6 @@ static int unmerge_hierarchy(const char *p) { static int unmerge(void) { int r, ret = 0; - char **p; STRV_FOREACH(p, arg_hierarchies) { _cleanup_free_ char *resolved = NULL; @@ -161,7 +160,6 @@ static int verb_unmerge(int argc, char **argv, void *userdata) { static int verb_status(int argc, char **argv, void *userdata) { _cleanup_(table_unrefp) Table *t = NULL; int r, ret = 0; - char **p; t = table_new("hierarchy", "extensions", "since"); if (!t) @@ -245,7 +243,6 @@ static int mount_overlayfs( _cleanup_free_ char *options = NULL; bool separator = false; - char **l; int r; assert(where); @@ -285,7 +282,6 @@ static int merge_hierarchy( _cleanup_free_ char *resolved_hierarchy = NULL, *f = NULL, *buf = NULL; _cleanup_strv_free_ char **layers = NULL; struct stat st; - char **p; int r; assert(hierarchy); @@ -453,7 +449,6 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { size_t n_extensions = 0; unsigned n_ignored = 0; Image *img; - char **h; int r; /* Mark the whole of /run as MS_SLAVE, so that we can mount stuff below it that doesn't show up on @@ -764,7 +759,6 @@ static int image_discover_and_read_metadata(Hashmap **ret_images) { static int verb_merge(int argc, char **argv, void *userdata) { _cleanup_(hashmap_freep) Hashmap *images = NULL; - char **p; int r; if (!have_effective_cap(CAP_SYS_ADMIN)) -- cgit v1.2.1