From d8ea389c19b9d193d866140992c2d9351f005a77 Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Tue, 17 Nov 2020 16:26:25 +0900 Subject: [PATCH] Return -EPERM when get acces denied dbus error Change-Id: Ib604ef0d837a93cf0d47f3de0ed4f2a207768987 Signed-off-by: Yunmi Ha --- src/libgdbus/dbus-system.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libgdbus/dbus-system.c b/src/libgdbus/dbus-system.c index ca1bd5d..cb63c88 100644 --- a/src/libgdbus/dbus-system.c +++ b/src/libgdbus/dbus-system.c @@ -1864,7 +1864,12 @@ GVariant *dbus_handle_method_sync_with_reply_var(const char *dest, if (!ret || err) { if (err) { _E("failed to g_dbus_connection_call_sync:%s", err->message); + if (g_error_matches(err, G_DBUS_ERROR, G_DBUS_ERROR_ACCESS_DENIED)) + ret = g_variant_new("(i)", -EPERM); + else + ret = NULL; g_error_free(err); + return ret; } else { _E("failed to g_dbus_connection_call_sync"); } -- 2.7.4