Adapt testfilemonitor.c for libinotify-kqueue backend

The backend mimics inotify but is still subject to kevent idionsyncracies.
This commit is contained in:
Gleb Popov 2024-07-24 16:02:30 +03:00
parent 7460faf861
commit 697118dfd5

View File

@ -116,11 +116,15 @@ static const gchar DONT_CARE[] = "";
static Environment static Environment
get_environment (GFileMonitor *monitor) get_environment (GFileMonitor *monitor)
{ {
if (g_str_equal (G_OBJECT_TYPE_NAME (monitor), "GInotifyFileMonitor")) #if defined(FILE_MONITOR_BACKEND_INOTIFY)
return INOTIFY; return INOTIFY;
if (g_str_equal (G_OBJECT_TYPE_NAME (monitor), "GKqueueFileMonitor")) #elif defined(FILE_MONITOR_BACKEND_KQUEUE)
return KQUEUE; return KQUEUE;
#elif defined(FILE_MONITOR_BACKEND_LIBINOTIFY_KQUEUE)
return INOTIFY | KQUEUE;
#else
return NONE; return NONE;
#endif
} }
static void static void