summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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,