From 1ce31b2a006382ce79d0baa1496345b2c35bc82e Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Thu, 20 Mar 2025 20:52:00 -0400 Subject: [PATCH] Fixed dirmonitor. --- src/api/dirmonitor/inotify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/dirmonitor/inotify.c b/src/api/dirmonitor/inotify.c index 4d2f845..117e728 100644 --- a/src/api/dirmonitor/inotify.c +++ b/src/api/dirmonitor/inotify.c @@ -37,8 +37,10 @@ int get_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, in int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int length, int (*change_callback)(int, const char*, void*), void* data) { - for (struct inotify_event* info = (struct inotify_event*)buffer; (char*)info < buffer + length; info = (struct inotify_event*)((char*)info + sizeof(struct inotify_event))) - change_callback(info->wd, NULL, data); + for (struct inotify_event* info = (struct inotify_event*)buffer; (char*)info < buffer + length; info = (struct inotify_event*)((char*)info + sizeof(struct inotify_event))) { + if ((info->mask & (~IN_IGNORED)) > 0) + change_callback(info->wd, NULL, data); + } return 0; }