Fix assert with dmon on directory deleting

This commit is contained in:
Francesco Abbate 2021-10-23 15:46:30 +02:00
parent d41aed61c9
commit 80d837b05b
1 changed files with 5 additions and 2 deletions

View File

@ -927,8 +927,11 @@ _DMON_PRIVATE void dmon__inotify_process_events(void)
dmon__strcat(watchdir, sizeof(watchdir), "/"); dmon__strcat(watchdir, sizeof(watchdir), "/");
uint32_t mask = IN_MOVED_TO | IN_CREATE | IN_MOVED_FROM | IN_DELETE | IN_MODIFY; uint32_t mask = IN_MOVED_TO | IN_CREATE | IN_MOVED_FROM | IN_DELETE | IN_MODIFY;
int wd = inotify_add_watch(watch->fd, watchdir, mask); int wd = inotify_add_watch(watch->fd, watchdir, mask);
_DMON_UNUSED(wd); // Removing the assertion below because it was giving errors for some reason
DMON_ASSERT(wd != -1); // when building a new package.
// _DMON_UNUSED(wd);
// DMON_ASSERT(wd != -1);
if (wd == -1) continue;
dmon__watch_subdir subdir; dmon__watch_subdir subdir;
dmon__strcpy(subdir.rootdir, sizeof(subdir.rootdir), watchdir); dmon__strcpy(subdir.rootdir, sizeof(subdir.rootdir), watchdir);