kdbus: fix g_dbus_connection_call_sync ("NameHasOwner") failure 43/101343/2
authorINSUN PYO <insun.pyo@samsung.com>
Thu, 1 Dec 2016 02:11:03 +0000 (11:11 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 1 Dec 2016 07:04:31 +0000 (23:04 -0800)
commit433d54698a0d67e9d1a819aafbfed1a8cf9aefe7
tree7b565245c8b96ef417bfc1571ca7bd7649c53df2
parent677b6d8e2142b9e99aaac0f1f757244936070cfc
kdbus: fix g_dbus_connection_call_sync ("NameHasOwner") failure

The caller _dbus_daemon_synthetic_reply function uses the error for a special purpose.
So, _g_kdbus_NamehasOwner never makes error and only return FALSE even if an error occurs.

================ the call stck of failure =====================================
0  g_kdbus_NameHasOwner_internal (worker=worker@entry=0x42a40, name=name@entry=0x5df78 "org.not.existing.busname") at gkdbus.c:1190
1  0xb6f18a0c in _g_kdbus_NameHasOwner (worker=worker@entry=0x42a40, name=0x5df78 "org.not.existing.busname", error=error@entry=0xbefff6d0) at gkdbus.c:1314   ==> generate gdbus error
2  0xb6f1a526 in _dbus_daemon_synthetic_reply (worker=worker@entry=0x42a40, message=message@entry=0x57c60) at gkdbusfakedaemon.c:542  ==> This function only check error value rather than return value.  So, after appling patch, this logic has been changed.
3  0xb6f19a9c in _g_kdbus_worker_send_message_sync (worker=0x42a40, message=message@entry=0x57c60, out_reply=out_reply@entry=0xbefff768, timeout_msec=timeout_msec@entry=-1, cancellable=cancellable@entry=0x0, error=error@entry=0xbefff7ac) at gkdbus.c:3888
4  0xb6f3fe78 in g_dbus_connection_send_message_with_reply_sync (connection=connection@entry=0x421e0, message=message@entry=0x57c60, flags=G_DBUS_SEND_MESSAGE_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, out_serial=0xbefff76c, out_serial@entry=0x0, cancellable=0x0, error=error@entry=0xbefff7ac) at gdbusconnection.c:3019
5  0xb6f4013e in g_dbus_connection_call_sync_internal (connection=0x421e0, bus_name=<optimized out>, object_path=0x24058 "/org/freedesktop/DBus", interface_name=0x24040 "org.freedesktop.DBus", method_name=method_name@entry=0x24030 "NameHasOwner", parameters=parameters@entry=0x3d6a8, reply_type=reply_type@entry=0x24130, flags=flags@entry=G_DBUS_CALL_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, fd_list=fd_list@entry=0x0, out_fd_list=out_fd_list@entry=0x0, cancellable=cancellable@entry=0x0, error=error@entry=0xbefff83c) at gdbusconnection.c:6641
6  0xb6f4187a in g_dbus_connection_call_sync (connection=<optimized out>, bus_name=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, method_name=0x24030 "NameHasOwner", parameters=0x3d6a8, reply_type=0x24130, flags=G_DBUS_CALL_FLAGS_NONE, timeout_msec=-1, cancellable=0x0, error=0xbefff83c) at gdbusconnection.c:6868
==============================================================================

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I4959eaeeaad79de641f6b0c1ce10020ae9fe3760
gio/gkdbus.c