From fc8df3fe9cd15fe7b0b86c6584e0b3fb487d6886 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 17 Jun 2025 11:23:41 -0400 Subject: Handle possible IN_IGNORED from inotify Signed-off-by: Andrew Opalach --- src/fs_event/fs_event_inotify.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fs_event/fs_event_inotify.c b/src/fs_event/fs_event_inotify.c index e0c48fa..7def7a3 100644 --- a/src/fs_event/fs_event_inotify.c +++ b/src/fs_event/fs_event_inotify.c @@ -13,10 +13,14 @@ static void event_callback(struct ev_loop *loop, ev_io *w, s32 revents) (void)revents; struct inotify_event event = { 0 }; ssize_t ret = nn_read(fs->fd, &event, sizeof(struct inotify_event)); - if (ret == sizeof(struct inotify_event)) { - al_assert(event.wd == fs->wd && event.len == 0); - fs->callback(fs->userdata, &event); + if (!(event.mask & IN_CLOSE_WRITE)) { + // Expecting IN_IGNORED. + return; } + al_assert(ret == sizeof(struct inotify_event)); + al_assert(event.wd == fs->wd); + al_assert(event.len == 0); + fs->callback(fs->userdata, &event); } void nn_fs_event_init(struct nn_fs_event *fs, str *path, u32 mask, -- cgit v1.2.3-101-g0448