2004-08-26 Jon Trowbridge <trow@ximian.com>
authorJon Trowbridge <trow@ximian.com>
Thu, 26 Aug 2004 17:26:06 +0000 (17:26 +0000)
committerJon Trowbridge <trow@ximian.com>
Thu, 26 Aug 2004 17:26:06 +0000 (17:26 +0000)
        * bus/driver.c (bus_driver_handle_service_exists): Respond with
        TRUE if we are inquiring about the existence of the built-in
        org.freedesktop.DBus service.

ChangeLog
bus/driver.c

index 45c8369..ba29548 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-26  Jon Trowbridge  <trow@ximian.com>
+
+       * bus/driver.c (bus_driver_handle_service_exists): Respond with
+       TRUE if we are inquiring about the existence of the built-in
+       org.freedesktop.DBus service.
+
 2004-08-25  John Palmieri  <johnp@redhat.com>
        * bus/config-parser.c:
        (struct PolicyType): Add POLICY_CONSOLE
index 9923f12..90659cd 100644 (file)
@@ -511,6 +511,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
   DBusMessage *reply;
   DBusString service_name;
   BusService *service;
+  dbus_bool_t service_exists;
   char *name;
   dbus_bool_t retval;
   BusRegistry *registry;
@@ -525,10 +526,18 @@ bus_driver_handle_service_exists (DBusConnection *connection,
     return FALSE;
 
   retval = FALSE;
+
+  if (strcmp (name, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS) == 0)
+    {
+      service_exists = TRUE;
+    }
+  else
+    {
+      _dbus_string_init_const (&service_name, name);
+      service = bus_registry_lookup (registry, &service_name);
+      service_exists = service != NULL;
+    }
   
-  _dbus_string_init_const (&service_name, name);
-  service = bus_registry_lookup (registry, &service_name);
   reply = dbus_message_new_method_return (message);
   if (reply == NULL)
     {
@@ -537,7 +546,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
     }
 
   if (!dbus_message_append_args (reply,
-                                 DBUS_TYPE_BOOLEAN, service != NULL,
+                                 DBUS_TYPE_BOOLEAN, service_exists,
                                  0))
     {
       BUS_SET_OOM (error);