diff options
author | Stefano Karapetsas <[email protected]> | 2013-12-31 11:39:20 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-12-31 11:39:20 -0800 |
commit | 2a9f47827c557c32f36ef6c50827ca616db5ecea (patch) | |
tree | 4ca5d50ddaaa810e56a1ec6c99208939c66a702a /mate-session | |
parent | e934e91226e9a93956121c9c84ecf3664fcd68be (diff) | |
parent | 3319a9bcff2059d474323daf666dd74bc3723621 (diff) | |
download | mate-session-manager-2a9f47827c557c32f36ef6c50827ca616db5ecea.tar.bz2 mate-session-manager-2a9f47827c557c32f36ef6c50827ca616db5ecea.tar.xz |
Merge pull request #40 from infirit/1.6
Cherrypick usefull commits from master
Diffstat (limited to 'mate-session')
-rw-r--r-- | mate-session/gsm-systemd.c | 20 | ||||
-rw-r--r-- | mate-session/test-client-dbus.c | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/mate-session/gsm-systemd.c b/mate-session/gsm-systemd.c index dbe8ea0..3804fed 100644 --- a/mate-session/gsm-systemd.c +++ b/mate-session/gsm-systemd.c @@ -547,7 +547,7 @@ gsm_systemd_set_session_idle (GsmSystemd *manager, gboolean is_idle) { GError *error; - char *session_path; + char *session_path = NULL; DBusMessage *message; DBusMessage *reply; DBusError dbus_error; @@ -564,6 +564,8 @@ gsm_systemd_set_session_idle (GsmSystemd *manager, gsm_systemd_get_session_path (dbus_g_connection_get_connection (manager->priv->dbus_connection), &session_path); + g_return_if_fail (session_path != NULL); + g_debug ("Updating Systemd idle status: %d", is_idle); message = dbus_message_new_method_call (SD_NAME, session_path, @@ -600,7 +602,9 @@ gsm_systemd_can_switch_user (GsmSystemd *manager) { GError *error; char *session_id = NULL; +#ifdef HAVE_SYSTEMD char *seat_id = NULL; +#endif int ret = 0; error = NULL; @@ -811,7 +815,7 @@ gsm_systemd_attempt_hibernate (GsmSystemd *manager) g_warning ("Could not connect to Systemd: %s", error->message); g_error_free (error); - return FALSE; + return; } res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy, @@ -825,7 +829,7 @@ gsm_systemd_attempt_hibernate (GsmSystemd *manager) g_warning ("Could not make DBUS call: %s", error->message); g_error_free (error); - return FALSE; + return; } } @@ -842,7 +846,7 @@ gsm_systemd_attempt_suspend (GsmSystemd *manager) g_warning ("Could not connect to Systemd: %s", error->message); g_error_free (error); - return FALSE; + return; } res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy, @@ -856,7 +860,7 @@ gsm_systemd_attempt_suspend (GsmSystemd *manager) g_warning ("Could not make DBUS call: %s", error->message); g_error_free (error); - return FALSE; + return; } } @@ -864,9 +868,11 @@ gchar * gsm_systemd_get_current_session_type (GsmSystemd *manager) { GError *gerror; - int session_id; + gchar *session_id; gchar *session_class = NULL; +#ifdef HAVE_SYSTEMD int res; +#endif gerror = NULL; @@ -890,6 +896,8 @@ gsm_systemd_get_current_session_type (GsmSystemd *manager) g_warning ("Could not get Systemd session class!"); return NULL; } + + g_free (session_id); #endif return session_class; diff --git a/mate-session/test-client-dbus.c b/mate-session/test-client-dbus.c index fa888ed..8f8fbe9 100644 --- a/mate-session/test-client-dbus.c +++ b/mate-session/test-client-dbus.c @@ -240,7 +240,9 @@ main (int argc, g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); +#if !GLIB_CHECK_VERSION (2, 36, 0) g_type_init (); +#endif res = session_manager_connect (); if (! res) { |