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/test/test-execute.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/test/test-execute.c')
-rw-r--r-- | src/test/test-execute.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 8e18bbdb01..a2758b3f84 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -610,7 +610,6 @@ static int find_libraries(const char *exec, char ***ret) { _cleanup_strv_free_ char **v = NULL; assert_se(strv_split_newlines_full(&v, result, 0) >= 0); - char **q; STRV_FOREACH(q, v) { _cleanup_free_ char *word = NULL; const char *p = *q; @@ -678,7 +677,6 @@ static void test_exec_mount_apivfs(Manager *m) { assert_se(strextend(&data, "BindReadOnlyPaths=", fullpath_touch, "\n")); assert_se(strextend(&data, "BindReadOnlyPaths=", fullpath_test, "\n")); - char **p; STRV_FOREACH(p, libraries) assert_se(strextend(&data, "BindReadOnlyPaths=", *p, "\n")); |