summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lunn <tim@feathertop.org>2012-10-15 09:10:37 +1100
committerRay Strode <rstrode@redhat.com>2012-10-15 14:53:14 -0400
commit081fc256e106313dc754f8178ac489ce1763f82d (patch)
tree696e93be48884b16d38a24fb9fb6e4744742c48b
parent7cafff03c4bd012ac485613d254dd94aa44376a5 (diff)
downloadgdm-081fc256e106313dc754f8178ac489ce1763f82d.tar.gz
simple-greeter: fix shutdown and restart on console kit systems
On Ubuntu 12.10 (console-kit), the dbus error returned when trying to call the non-existant systemd interface is "Service Unknown" and not "Name has no owner" as is expected in the try_system_(restart/stop) functions. https://bugzilla.gnome.org/show_bug.cgi?id=686125
-rw-r--r--gui/simple-greeter/gdm-greeter-panel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gui/simple-greeter/gdm-greeter-panel.c b/gui/simple-greeter/gdm-greeter-panel.c
index 7157a9f4..ce00b90c 100644
--- a/gui/simple-greeter/gdm-greeter-panel.c
+++ b/gui/simple-greeter/gdm-greeter-panel.c
@@ -646,7 +646,8 @@ try_system_stop (GDBusConnection *connection,
NULL,
&call_error);
- if (reply == NULL && g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER)) {
+ if (reply == NULL && (g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER) ||
+ g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))) {
g_clear_error (&call_error);
reply = g_dbus_connection_call_sync (connection,
CK_NAME,
@@ -695,7 +696,8 @@ try_system_restart (GDBusConnection *connection,
NULL,
&call_error);
- if (reply == NULL && g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER)) {
+ if (reply == NULL && (g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER)||
+ g_error_matches (call_error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))) {
g_clear_error (&call_error);
reply = g_dbus_connection_call_sync (connection,
CK_NAME,