[gvfs/gdbus: 6/30] gdbus: Suppose that g_bus_watch_name() never returns zero



commit f3c68b016684e4c973e089399740720ae1829dea
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Fri May 27 17:44:49 2011 +0200

    gdbus: Suppose that g_bus_watch_name() never returns zero
    
    g_bus_watch_name() never returns zero so we can use it to distinguish
    if watching has been started or not.

 monitor/proxy/gvfsproxyvolumemonitordaemon.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/monitor/proxy/gvfsproxyvolumemonitordaemon.c b/monitor/proxy/gvfsproxyvolumemonitordaemon.c
index f42ab6e..58ada07 100644
--- a/monitor/proxy/gvfsproxyvolumemonitordaemon.c
+++ b/monitor/proxy/gvfsproxyvolumemonitordaemon.c
@@ -489,7 +489,7 @@ on_name_owner_vanished (GDBusConnection *connection,
     }
   else
     {
-      g_bus_unwatch_name (name_watcher_id - 1);
+      g_bus_unwatch_name (name_watcher_id);
     }
 
   g_hash_table_remove (unique_names_being_watched, name);
@@ -515,7 +515,7 @@ ensure_name_owner_changed_for_unique_name (GDBusMethodInvocation *invocation)
                                                     on_name_owner_vanished,
                                                     NULL,
                                                     NULL);
-  g_hash_table_insert (unique_names_being_watched, g_strdup (unique_name), (gpointer) (name_watcher_id + 1));
+  g_hash_table_insert (unique_names_being_watched, g_strdup (unique_name), (gpointer) name_watcher_id);
 
  out:
   G_UNLOCK (unique_names_being_watched_lock);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]