Commit 8fb8b406 authored by David Zeuthen's avatar David Zeuthen

PolkitUnixSession: Actually return TRUE if a session exists

Also, don't treat the integer returned by sd_session_get_uid() as a
boolean because that's just confusing.
Signed-off-by: default avatarDavid Zeuthen <>
parent c46d2d13
......@@ -361,17 +361,15 @@ polkit_unix_session_to_string (PolkitSubject *subject)
static gboolean
polkit_unix_session_exists_sync (PolkitSubject *subject,
GCancellable *cancellable,
GError **error)
GCancellable *cancellable,
GError **error)
PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
gboolean ret;
gboolean ret = FALSE;
uid_t uid;
ret = FALSE;
if (!sd_session_get_uid (session->session_id, &uid))
ret = FALSE;
if (sd_session_get_uid (session->session_id, &uid) == 0)
ret = TRUE;
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment