summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-07 15:02:55 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-15 16:19:13 +0100
commitc7f0d9e5acef3f62db3640d5ab7446241c022b35 (patch)
treed8312bdb6ba90d0277306ba8f3b08dc391759e5a /src/udev/udev-watch.c
parentwait-online: also use address state even when operational state is below degr... (diff)
downloadsystemd-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/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index 87c4f09928..a8b7d2d2d1 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -20,7 +20,6 @@
#define MIN_RANDOM_DELAY ( 10 * USEC_PER_MSEC)
int udev_watch_restore(int inotify_fd) {
- struct dirent *ent;
DIR *dir;
int r;