Fixed bug 91 (GIO monitoring not working due to bad assert)
authorMures Andone <mures.andone@movial.com>
Tue, 10 Nov 2009 12:59:31 +0000 (14:59 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 26 Nov 2009 14:40:01 +0000 (15:40 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=593856

gio/inotify/ginotifydirectorymonitor.c
gio/inotify/ginotifyfilemonitor.c

index dd6a28a..f6fcde7 100644 (file)
@@ -76,6 +76,7 @@ g_inotify_directory_monitor_constructor (GType type,
   GInotifyDirectoryMonitor *inotify_monitor;
   const gchar *dirname = NULL;
   inotify_sub *sub = NULL;
+  gboolean ret_ih_startup; /* return value of _ih_startup, for asserting */ 
   
   klass = G_INOTIFY_DIRECTORY_MONITOR_CLASS (g_type_class_peek (G_TYPE_INOTIFY_DIRECTORY_MONITOR));
   parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
@@ -90,13 +91,18 @@ g_inotify_directory_monitor_constructor (GType type,
 
   /* Will never fail as is_supported() should be called before instanciating
    * anyway */
-  g_assert (_ih_startup ());
+  /* assert on return value */
+  ret_ih_startup = _ih_startup();
+  g_assert (ret_ih_startup);
 
   sub = _ih_sub_new (dirname, NULL, inotify_monitor);
   /* FIXME: what to do about errors here? we can't return NULL or another
    * kind of error and an assertion is probably too hard */
   g_assert (sub != NULL);
-  g_assert (_ih_sub_add (sub));
+  
+  /* _ih_sub_add allways returns TRUE, see gio/inotify/inotify-helper.c line 109
+   * g_assert (_ih_sub_add (sub)); */
+  _ih_sub_add(sub);
 
   inotify_monitor->sub = sub;
 
index 0dff7f3..8e572ca 100644 (file)
@@ -90,6 +90,7 @@ g_inotify_file_monitor_constructor (GType                  type,
   GInotifyFileMonitor *inotify_monitor;
   const gchar *filename = NULL;
   inotify_sub *sub = NULL;
+  gboolean ret_ih_startup; /* return value of _ih_startup, for asserting */    
   
   klass = G_INOTIFY_FILE_MONITOR_CLASS (g_type_class_peek (G_TYPE_INOTIFY_FILE_MONITOR));
   parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
@@ -108,14 +109,19 @@ g_inotify_file_monitor_constructor (GType                  type,
 
   /* Will never fail as is_supported() should be called before instanciating
    * anyway */
-  g_assert (_ih_startup ());
+  /* assert on return value */
+  ret_ih_startup = _ih_startup();
+  g_assert (ret_ih_startup);
 
   sub = _ih_sub_new (inotify_monitor->dirname, inotify_monitor->filename, inotify_monitor);
  
   /* FIXME: what to do about errors here? we can't return NULL or another
    * kind of error and an assertion is probably too hard */
   g_assert (sub != NULL);
-  g_assert (_ih_sub_add (sub));
+
+  /* _ih_sub_add allways returns TRUE, see gio/inotify/inotify-helper.c line 109
+   * g_assert (_ih_sub_add (sub)); */
+  _ih_sub_add (sub);
 
   inotify_monitor->sub = sub;