static void _ecore_file_monitor_inotify_print(char *file, int mask);
#endif
+static Eina_Hash *monitor_hash;
+
int
ecore_file_monitor_backend_init(void)
{
}
_inotify_fd_pid = getpid();
+ monitor_hash = eina_hash_int32_new(NULL);
return 1;
}
if (_monitors)
_monitors = ECORE_FILE_MONITOR(eina_inlist_remove(EINA_INLIST_GET(_monitors), EINA_INLIST_GET(em)));
+ if (ECORE_FILE_MONITOR_INOTIFY(em)->wd >= 0)
+ eina_hash_del_by_key(monitor_hash, &ECORE_FILE_MONITOR_INOTIFY(em)->wd);
fd = ecore_main_fd_handler_fd_get(_fdh);
if (ECORE_FILE_MONITOR_INOTIFY(em)->wd)
static Ecore_File_Monitor *
_ecore_file_monitor_inotify_monitor_find(int wd)
{
- Ecore_File_Monitor *l;
-
- EINA_INLIST_FOREACH(_monitors, l)
- {
- if (ECORE_FILE_MONITOR_INOTIFY(l)->wd == wd)
- return l;
- }
- return NULL;
+ return eina_hash_find(monitor_hash, &wd);
}
static void
ecore_file_monitor_backend_del(em);
return 0;
}
+ eina_hash_add(monitor_hash, &ECORE_FILE_MONITOR_INOTIFY(em)->wd, em);
return 1;
}