1 From 8fb8b406bab50c5ef8c5d4f743e3f13924bd5f73 Mon Sep 17 00:00:00 2001
2 From: David Zeuthen <davidz@redhat.com>
3 Date: Mon, 6 Feb 2012 11:26:06 -0500
4 Subject: [PATCH 2/2] PolkitUnixSession: Actually return TRUE if a session exists
6 Also, don't treat the integer returned by sd_session_get_uid() as a
7 boolean because that's just confusing.
9 Signed-off-by: David Zeuthen <davidz@redhat.com>
12 Upstream-status: Accepted
14 src/polkit/polkitunixsession-systemd.c | 12 +++++-------
15 1 files changed, 5 insertions(+), 7 deletions(-)
17 diff --git a/src/polkit/polkitunixsession-systemd.c b/src/polkit/polkitunixsession-systemd.c
18 index 94a7ee4..8a8bf65 100644
19 --- a/src/polkit/polkitunixsession-systemd.c
20 +++ b/src/polkit/polkitunixsession-systemd.c
21 @@ -361,17 +361,15 @@ polkit_unix_session_to_string (PolkitSubject *subject)
24 polkit_unix_session_exists_sync (PolkitSubject *subject,
25 - GCancellable *cancellable,
27 + GCancellable *cancellable,
30 PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
32 + gboolean ret = FALSE;
37 - if (!sd_session_get_uid (session->session_id, &uid))
39 + if (sd_session_get_uid (session->session_id, &uid) == 0)