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/shared/blockdev-util.c | |
parent | 372e8592c6e3a891174344be0899a91769ef61af (diff) | |
download | systemd-c7f0d9e5acef3f62db3640d5ab7446241c022b35.tar.gz |
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/shared/blockdev-util.c')
-rw-r--r-- | src/shared/blockdev-util.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/shared/blockdev-util.c b/src/shared/blockdev-util.c index db50505c9a..a0c60be26e 100644 --- a/src/shared/blockdev-util.c +++ b/src/shared/blockdev-util.c @@ -103,7 +103,6 @@ int block_get_originating(dev_t dt, dev_t *ret) { _cleanup_free_ char *t = NULL; char p[SYS_BLOCK_PATH_MAX("/slaves")]; _cleanup_free_ char *first_found = NULL; - struct dirent *de; const char *q; dev_t devt; int r; |