summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-06-17 11:23:41 -0400
committerAndrew Opalach <andrew@akon.city> 2025-06-17 11:23:41 -0400
commitfc8df3fe9cd15fe7b0b86c6584e0b3fb487d6886 (patch)
tree473202888e66ed87c5a6061afad1dc2d3b74b9c7
parent393e266f6bfceb25a97cd1cf28dfc72cac9e9f81 (diff)
downloadlibnaunet-fc8df3fe9cd15fe7b0b86c6584e0b3fb487d6886.tar.gz
libnaunet-fc8df3fe9cd15fe7b0b86c6584e0b3fb487d6886.tar.bz2
libnaunet-fc8df3fe9cd15fe7b0b86c6584e0b3fb487d6886.zip
Handle possible IN_IGNORED from inotify
Signed-off-by: Andrew Opalach <andrew@akon.city>
-rw-r--r--src/fs_event/fs_event_inotify.c10
1 files 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,