diff options
author | Robert Nagy <robert@openbsd.org> | 2022-11-10 10:52:54 +0100 |
---|---|---|
committer | Robert Nagy <robert@openbsd.org> | 2022-11-10 10:52:54 +0100 |
commit | c4e68a271d1ec922a3339385e3569f32040b710b (patch) | |
tree | 4b17de5e55d91ec099dc0eaa6c3dc61d5f9b9c28 | |
parent | 3b22b7cc4f1425390903811b773526aa5a318713 (diff) | |
download | ConsoleKit2-c4e68a271d1ec922a3339385e3569f32040b710b.tar.gz |
implement sd_seat_can_multi_session()
-rw-r--r-- | libconsolekit/sd-compat.c | 23 | ||||
-rw-r--r-- | libconsolekit/sd-login.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/libconsolekit/sd-compat.c b/libconsolekit/sd-compat.c index 69a1576..a5d60e5 100644 --- a/libconsolekit/sd-compat.c +++ b/libconsolekit/sd-compat.c @@ -142,3 +142,26 @@ sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions) return ret; } + +int +sd_seat_can_multi_session(const char *seat) +{ + LibConsoleKit *ck = NULL; + GError *error = NULL; + gboolean can_activate = FALSE; + + ck = lib_consolekit_new (); + + can_activate = lib_consolekit_seat_can_multi_session (ck, seat, &error); + if (error) { + g_warning ("Unable to determine if seat can activate sessions: %s", + error ? error->message : ""); + g_error_free (error); + g_object_unref (ck); + return FALSE; + } + + g_object_unref (ck); + + return can_activate; +} diff --git a/libconsolekit/sd-login.h b/libconsolekit/sd-login.h index 262966c..8312d7b 100644 --- a/libconsolekit/sd-login.h +++ b/libconsolekit/sd-login.h @@ -6,3 +6,5 @@ int sd_session_get_type(const char *session, char **type); int sd_session_get_state(const char *session, char **state); int sd_session_get_uid(const char *session, uid_t *uid); int sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions); + +int sd_seat_can_multi_session(const char *seat); |