summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-24 17:58:07 +0900
committerLuca Boccassi <luca.boccassi@gmail.com>2022-03-24 23:12:34 +0000
commit00adc340bb15bc9d634db6caa48f1c964b99f79a (patch)
tree26c4b95de937589754f9db91cdba6283b16db150 /src/timesync
parentf72f8021182f930bb86ff4e3a05b8f09fa7d3179 (diff)
downloadsystemd-00adc340bb15bc9d634db6caa48f1c964b99f79a.tar.gz
inotify-util: declare iterator in FOREACH_INOTIFY_EVENT()
This also makes the macro check if the event is actually in the buffer, and if it is not, then log about that and finish the loop.
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/wait-sync.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/timesync/wait-sync.c b/src/timesync/wait-sync.c
index f42e6496bb..57e6cd3403 100644
--- a/src/timesync/wait-sync.c
+++ b/src/timesync/wait-sync.c
@@ -80,7 +80,6 @@ static int inotify_handler(sd_event_source *s,
sd_event *event = sd_event_source_get_event(s);
ClockState *sp = userdata;
union inotify_event_buffer buffer;
- struct inotify_event *e;
ssize_t l;
l = read(fd, &buffer, sizeof(buffer));
@@ -90,7 +89,7 @@ static int inotify_handler(sd_event_source *s,
return log_warning_errno(errno, "Lost access to inotify: %m");
}
- FOREACH_INOTIFY_EVENT(e, buffer, l)
+ FOREACH_INOTIFY_EVENT_WARN(e, buffer, l)
process_inotify_event(event, sp, e);
return 0;