org.freedesktop.DBus.ReloadConfig not sending a reply

Sjoerd Simons sjoerd at luon.net
Mon Oct 31 00:34:54 PST 2005


Hi,

 I noticed that org.freedesktop.DBus.ReloadConfig doesn't send out a reply.
 From what i understand from dbus, methods should always send out a reply so
 that's a little odd? 

 Also it's nice to know when the bus actually handled the message and reloaded
 the config. So even an empty reply is usefull.

 Attached patch let's ReloadConfig send out an empty reply. 

  Sjoerd
-- 
Let us not look back in anger or forward in fear, but around us in awareness.
		-- James Thurber
-------------- next part --------------
Index: bus/driver.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/driver.c,v
retrieving revision 1.73
diff -u -r1.73 driver.c
--- bus/driver.c	3 Oct 2005 19:55:56 -0000	1.73
+++ bus/driver.c	31 Oct 2005 08:28:05 -0000
@@ -1094,23 +1094,32 @@
 				 DBusError      *error)
 {
   BusContext *context;
-  dbus_bool_t retval;
+  DBusMessage *reply;
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
-  retval = FALSE;
-
   context = bus_connection_get_context (connection);
   if (!bus_context_reload_config (context, error))
-    {
-      _DBUS_ASSERT_ERROR_IS_SET (error);
-      goto out;
-    }
+    goto failed;
 
-  retval = TRUE;
-  
- out:
-  return retval;
+  reply = dbus_message_new_method_return (message);
+  if (reply == NULL)
+    goto oom;
+
+  if (! bus_transaction_send_from_driver (transaction, connection, reply))
+    goto oom;
+
+  dbus_message_unref (reply);
+  return TRUE;
+
+ oom:
+  BUS_SET_OOM (error);
+
+ failed:
+  _DBUS_ASSERT_ERROR_IS_SET (error);
+  if (reply)
+    dbus_message_unref (reply);
+  return FALSE;
 }
 
 /* For speed it might be useful to sort this in order of


More information about the dbus mailing list