[gdm] simple-greeter: fix shutdown and restart on console kit systems
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gdm] simple-greeter: fix shutdown and restart on console kit systems
- Date: Mon, 15 Oct 2012 18:53:28 +0000 (UTC)
commit 081fc256e106313dc754f8178ac489ce1763f82d
Author: Tim Lunn <tim feathertop org>
Date:   Mon Oct 15 09:10:37 2012 +1100
    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
 gui/simple-greeter/gdm-greeter-panel.c |    6 ++++--
 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 7157a9f..ce00b90 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,
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]