gdbus: change timeout error code from 'gdbus error' to 'gio error' 63/99463/1
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 22 Nov 2016 08:19:13 +0000 (17:19 +0900)
committersanghyeok oh <sanghyeok.oh@samsung.com>
Wed, 23 Nov 2016 03:06:49 +0000 (19:06 -0800)
sync/async call return different error code when timeout was occured
modify it to return G_IO_ERROR_TIMED_OUT

Change-Id: I7b9fb847240311ce40f59ab7d552aaa2efeecb45
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
(cherry picked from commit 7a6fcd470025060f220b51ed8a4ecd57cf2b84b7)

gio/gdbusconnection.c
gio/gkdbus.c

index be8b998..92b2948 100755 (executable)
@@ -6319,6 +6319,14 @@ decode_method_reply (GDBusMessage        *reply,
 
     case G_DBUS_MESSAGE_TYPE_ERROR:
       g_dbus_message_to_gerror (reply, error);
+      if ((*error)->code == G_DBUS_ERROR_NO_REPLY)
+        {
+          g_clear_error(error);
+          g_set_error (error,
+                       G_IO_ERROR,
+                       G_IO_ERROR_TIMED_OUT,
+                       _("Timeout was reached"));
+        }
       break;
 
     default:
index a69c826..f567aa5 100755 (executable)
@@ -3535,6 +3535,11 @@ _g_kdbus_send (GKDBusWorker  *worker,
           g_set_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED,
                        "Operation was cancelled, %s", info);
         }
+      else if (errno == ETIMEDOUT)
+        {
+          g_set_error (error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
+                       "Timeout was reached, %s", info);
+        }
       else
         {
           g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "%s, %s", g_strerror(errno), info);