diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-16 14:32:23 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-19 00:33:33 +0100 |
commit | de010b0b2e50cf0b3837ce350b116bc92605f67a (patch) | |
tree | 226685fbb97461692562035501ebc21a314f718c /src/sysctl/sysctl.c | |
parent | list: make LIST_FOREACH() and LIST_FOREACH_BACKWARDS() safer (diff) | |
download | systemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.tar.xz systemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.zip |
strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
Diffstat (limited to 'src/sysctl/sysctl.c')
-rw-r--r-- | src/sysctl/sysctl.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 408ac3b8be..24c8baab03 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -51,8 +51,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Option*, option_free); DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(option_hash_ops, char, string_hash_func, string_compare_func, Option, option_free); static bool test_prefix(const char *p) { - char **i; - if (strv_isempty(arg_prefixes)) return true; @@ -131,7 +129,6 @@ static int apply_all(OrderedHashmap *sysctl_options) { if (string_is_glob(option->key)) { _cleanup_strv_free_ char **paths = NULL; _cleanup_free_ char *pattern = NULL; - char **s; pattern = path_join("/proc/sys", option->key); if (!pattern) @@ -403,7 +400,6 @@ static int run(int argc, char *argv[]) { } } else { _cleanup_strv_free_ char **files = NULL; - char **f; r = conf_files_list_strv(&files, ".conf", NULL, 0, (const char**) CONF_PATHS_STRV("sysctl.d")); if (r < 0) |