diff --git a/configure.ac b/configure.ac index 1c400ad9c..c38cd3598 100644 --- a/configure.ac +++ b/configure.ac @@ -1665,8 +1665,7 @@ dnl ***************************** inotify_support=no AC_CHECK_HEADERS([sys/inotify.h], [ - inotify_support=yes - AC_CHECK_FUNCS(inotify_init1) + AC_CHECK_FUNCS(inotify_init1, [inotify_support=yes], [inotify_support=no]) ]) AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"]) diff --git a/gio/giomodule.c b/gio/giomodule.c index 5876fc534..219a7399f 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -1055,7 +1055,7 @@ _g_io_modules_ensure_loaded (void) /* Initialize types from built-in "modules" */ g_type_ensure (g_null_settings_backend_get_type ()); g_type_ensure (g_memory_settings_backend_get_type ()); -#if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H) +#if defined(HAVE_INOTIFY_INIT1) g_type_ensure (_g_inotify_directory_monitor_get_type ()); g_type_ensure (_g_inotify_file_monitor_get_type ()); #endif diff --git a/gio/inotify/inotify-kernel.c b/gio/inotify/inotify-kernel.c index 81294fa49..b672cb168 100644 --- a/gio/inotify/inotify-kernel.c +++ b/gio/inotify/inotify-kernel.c @@ -196,11 +196,8 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event)) initialized = TRUE; -#ifdef HAVE_INOTIFY_INIT1 inotify_instance_fd = inotify_init1 (IN_CLOEXEC); -#else - inotify_instance_fd = -1; -#endif + if (inotify_instance_fd < 0) inotify_instance_fd = inotify_init ();