diff options
author | Ted Gould <ted@gould.cx> | 2010-03-17 10:56:28 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-17 10:56:28 -0500 |
commit | 05b52fcee1c26b0f8dd703a61226ffdb60ff301e (patch) | |
tree | 3b29b19cea0a3fe9dc4b88ac67d3dba45e5fdd2a | |
parent | 494bb4fa4748456f16e5a852fd939b9500deb61e (diff) | |
download | ayatana-indicator-session-05b52fcee1c26b0f8dd703a61226ffdb60ff301e.tar.gz ayatana-indicator-session-05b52fcee1c26b0f8dd703a61226ffdb60ff301e.tar.bz2 ayatana-indicator-session-05b52fcee1c26b0f8dd703a61226ffdb60ff301e.zip |
Switching to getting locked proxies. Just to have more error handling.
-rw-r--r-- | src/users-service-dbus.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index 5d157ee..5b1bcd7 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -437,10 +437,17 @@ get_unix_user (UsersServiceDbus *service, guint uid; DBusGProxy *session_proxy; - session_proxy = dbus_g_proxy_new_for_name(priv->system_bus, - "org.freedesktop.ConsoleKit", - session_id, - "org.freedesktop.ConsoleKit.Session"); + session_proxy = dbus_g_proxy_new_for_name_owner(priv->system_bus, + "org.freedesktop.ConsoleKit", + session_id, + "org.freedesktop.ConsoleKit.Session", + &error); + + if (error != NULL) { + g_warning("Unable to get CK Session proxy: %s", error->message); + g_error_free(error); + return FALSE; + } if (org_freedesktop_ConsoleKit_Session_get_unix_user(session_proxy, &uid, &error)) { @@ -475,10 +482,17 @@ do_add_session (UsersServiceDbus *service, DBusGProxy * session_proxy; GList *l; - session_proxy = dbus_g_proxy_new_for_name(priv->system_bus, - "org.freedesktop.ConsoleKit", - ssid, - "org.freedesktop.ConsoleKit.Session"); + session_proxy = dbus_g_proxy_new_for_name_owner(priv->system_bus, + "org.freedesktop.ConsoleKit", + ssid, + "org.freedesktop.ConsoleKit.Session", + &error); + + if (error != NULL) { + g_warning("Unable to get CK Session proxy: %s", error->message); + g_error_free(error); + return FALSE; + } seat = get_seat_internal (session_proxy); |