diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-03-23 10:48:13 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-03-23 11:50:18 +0100 |
commit | 5980d463048f25411c55da2f6387cdc8eaeef4c8 (patch) | |
tree | e5c32417015bfd67d326d278b1cd7dac3ada39de /src/nspawn/nspawn.c | |
parent | 5b391395822575533ab0fc93485fc5554d0da099 (diff) | |
download | systemd-5980d463048f25411c55da2f6387cdc8eaeef4c8.tar.gz |
strv: declare iterator of FOREACH_STRING() in the loop
Same idea as 03677889f0ef42cdc534bf3b31265a054b20a354.
No functional change intended. The type of the iterator is generally changed to
be 'const char*' instead of 'char*'. Despite the type commonly used, modifying
the string was not allowed.
I adjusted the naming of some short variables for clarity and reduced the scope
of some variable declarations in code that was being touched anyway.
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r-- | src/nspawn/nspawn.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 7fab88b31a..e4c46866a0 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2564,7 +2564,7 @@ static int setup_hostname(void) { static int setup_journal(const char *directory) { _cleanup_free_ char *d = NULL; - const char *dirname, *p, *q; + const char *p, *q; sd_id128_t this_id; bool try; int r; @@ -3512,7 +3512,6 @@ static int inner_child( (void) fdset_close_others(fds); if (arg_start_mode == START_BOOT) { - const char *init; char **a; size_t m; @@ -4603,7 +4602,7 @@ static int load_settings(void) { _cleanup_(settings_freep) Settings *settings = NULL; _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *p = NULL; - const char *fn, *i; + const char *fn; int r; if (arg_oci_bundle) |