diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-12-07 15:02:55 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-12-15 16:19:13 +0100 |
commit | c7f0d9e5acef3f62db3640d5ab7446241c022b35 (patch) | |
tree | d8312bdb6ba90d0277306ba8f3b08dc391759e5a /src/basic/unit-file.c | |
parent | wait-online: also use address state even when operational state is below degr... (diff) | |
download | systemd-c7f0d9e5acef3f62db3640d5ab7446241c022b35.tar.xz systemd-c7f0d9e5acef3f62db3640d5ab7446241c022b35.zip |
tree-wide: make FOREACH_DIRENT_ALL define the iterator variable
The variable is not useful outside of the loop (it'll always be null
after the loop is finished), so we can declare it inline in the loop.
This saves one variable declaration and reduces the chances that somebody
tries to use the variable outside of the loop.
For consistency, 'de' is used everywhere for the var name.
Diffstat (limited to 'src/basic/unit-file.c')
-rw-r--r-- | src/basic/unit-file.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c index 89bfeceae4..30c632dfce 100644 --- a/src/basic/unit-file.c +++ b/src/basic/unit-file.c @@ -276,7 +276,6 @@ int unit_file_build_name_map( STRV_FOREACH(dir, (char**) lp->search_path) { _cleanup_closedir_ DIR *d = NULL; - struct dirent *de; d = opendir(*dir); if (!d) { |