From: Kichan Kwon Date: Thu, 6 Jul 2017 02:18:33 +0000 (+0900) Subject: common : explain why resourced doesn't use g_dbus_method_return_error X-Git-Tag: submit/tizen/20170803.075349~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F137438%2F7;p=platform%2Fcore%2Fsystem%2Fresourced.git common : explain why resourced doesn't use g_dbus_method_return_error - 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 --- diff --git a/src/common/dbus-handler.h b/src/common/dbus-handler.h index 1320721..49438f1 100644 --- a/src/common/dbus-handler.h +++ b/src/common/dbus-handler.h @@ -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)); \