]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: make FOREACH_DIRENT_ALL define the iterator variable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Dec 2021 14:02:55 +0000 (15:02 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 15 Dec 2021 15:19:13 +0000 (16:19 +0100)
commitc7f0d9e5acef3f62db3640d5ab7446241c022b35
treed8312bdb6ba90d0277306ba8f3b08dc391759e5a
parent372e8592c6e3a891174344be0899a91769ef61af
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.
31 files changed:
src/basic/cgroup-util.c
src/basic/dirent-util.h
src/basic/fs-util.c
src/basic/unit-file.c
src/core/manager.c
src/delta/delta.c
src/import/import-common.c
src/import/pull-common.c
src/journal/journald-server.c
src/libsystemd/sd-device/device-enumerator.c
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-journal/journal-vacuum.c
src/libsystemd/sd-journal/sd-journal.c
src/libsystemd/sd-login/sd-login.c
src/login/logind-dbus.c
src/nspawn/nspawn-patch-uid.c
src/resolve/resolved-manager.c
src/shared/blockdev-util.c
src/shared/chown-recursive.c
src/shared/clean-ipc.c
src/shared/copy.c
src/shared/discover-image.c
src/shared/killall.c
src/shared/rm-rf.c
src/tmpfiles/tmpfiles.c
src/udev/udev-builtin-net_id.c
src/udev/udev-builtin-path_id.c
src/udev/udev-node.c
src/udev/udev-rules.c
src/udev/udev-watch.c
src/udev/udevadm-info.c