common : explain why resourced doesn't use g_dbus_method_return_error 38/137438/7
authorKichan Kwon <k_c.kwon@samsung.com>
Thu, 6 Jul 2017 02:18:33 +0000 (11:18 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 24 Jul 2017 07:28:31 +0000 (16:28 +0900)
- cf) Process resource usage functions use return_error because
     it is only for Runtime-info (we can control this package)

Change-Id: Ia5ce23367ee4273eeca2b59c80096892fc1a6bb7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/common/dbus-handler.h

index 1320721..49438f1 100644 (file)
@@ -58,9 +58,19 @@ struct d_bus_signal {
        guint subscription_id;
 };
 
-//This code is better. However, this code needs to be verified.
-//#define D_BUS_REPLY_NULL(ivc) g_dbus_method_invocation_return_value(ivc, NULL);
-
+/*
+ * If reply signature is existed, GDBus allows the return type
+ * to declared type or error.
+ *
+ * However, before GDBus is applied, resourced returns NULL
+ * when error is occurred.
+ *
+ * Therefore, for backward compatibility, we don't use the function
+ * g_dbus_method_invocation_return_error and return NULL with sending new message
+ *
+ * cf) Process resource usage functions use return_error because
+ *     it is only for Runtime-info (we can control this package)
+ */
 #define D_BUS_REPLY_NULL(ivc)  \
 {      \
        GDBusMessage *re = g_dbus_message_new_method_reply(g_dbus_method_invocation_get_message(ivc));  \