After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737461 - Problem directory monitoring was not working anymore
Problem directory monitoring was not working anymore
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.41.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-09-26 20:02 UTC by Leandro
Modified: 2018-05-24 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Leandro 2014-09-26 20:02:32 UTC
Hi,

I use the inotify functions from glib (through g_file_monitor_directory) with glib version 2.28. I upgraded to version 2.40 and directory monitoring was not working anymore. 

Analyzing the problem, it seems to happen because I use an kenel 2.6.34-1 without the inotify_init1. The 2.40 version seems to check only for the presence of inotify_init1, it is not using inotify_init anymore. Although support using both seems possible as you can see bellow:

diff -u gio/inotify/inotify-kernel.c_old gio/inotify/inotify-kernel.c 
--- gio/inotify/inotify-kernel.c_old	2014-09-18 10:54:53.060666721 -0300
+++ gio/inotify/inotify-kernel.c	2014-09-19 17:25:15.638938134 -0300
@@ -196,7 +196,9 @@
 
   initialized = TRUE;
 
+#if defined(HAVE_INOTIFY_INIT1)
   inotify_instance_fd = inotify_init1 (IN_CLOEXEC);
+#endif
 
   if (inotify_instance_fd < 0)
     inotify_instance_fd = inotify_init ();

-------------------------------------------------------------------------

diff -u gio/giomodule.c_old gio/giomodule.c
--- gio/giomodule.c_old	2014-09-19 16:54:53.747857935 -0300
+++ gio/giomodule.c	2014-09-19 16:56:05.256250125 -0300
@@ -1055,7 +1055,7 @@
       /* 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_INOTIFY_INIT1)
+#if defined(HAVE_SYS_INOTIFY_H)
       g_type_ensure (_g_inotify_directory_monitor_get_type ());
       g_type_ensure (_g_inotify_file_monitor_get_type ());
 #endif

-------------------------------------------------------------------------

diff -u configure.ac_old  configure.ac
--- configure.ac_old	2014-09-18 10:54:52.935673027 -0300
+++ configure.ac	2014-09-19 16:52:08.513194513 -0300
@@ -1668,10 +1668,12 @@
 dnl *****************************
 dnl ** Check for inotify (GIO) **
 dnl *****************************
+
 inotify_support=no
 AC_CHECK_HEADERS([sys/inotify.h],
 [
-  AC_CHECK_FUNCS(inotify_init1, [inotify_support=yes], [inotify_support=no])
+    inotify_support=yes
+    AC_CHECK_FUNCS(inotify_init1)
 ])
 
 AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])




thanks
Comment 1 GNOME Infrastructure Team 2018-05-24 17:03:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/932.