logind: Remove session type check
This commit is contained in:
parent
24c66d8c08
commit
8ab3fc03aa
1 changed files with 0 additions and 14 deletions
|
@ -637,7 +637,6 @@ out:
|
|||
static bool get_display_session(char **session_id) {
|
||||
assert(session_id != NULL);
|
||||
char *xdg_session_id = getenv("XDG_SESSION_ID");
|
||||
char *type = NULL;
|
||||
char *state = NULL;
|
||||
|
||||
if (xdg_session_id) {
|
||||
|
@ -669,17 +668,6 @@ static bool get_display_session(char **session_id) {
|
|||
|
||||
assert(*session_id != NULL);
|
||||
|
||||
// Check that the available session is graphical
|
||||
ret = sd_session_get_type(*session_id, &type);
|
||||
if (ret < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
const char *graphical_session_types[] = {"wayland", "x11", "mir", NULL};
|
||||
if (!contains_str(type, graphical_session_types)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Check that the session is active
|
||||
ret = sd_session_get_state(*session_id, &state);
|
||||
if (ret < 0) {
|
||||
|
@ -691,12 +679,10 @@ static bool get_display_session(char **session_id) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
free(type);
|
||||
free(state);
|
||||
return true;
|
||||
|
||||
error:
|
||||
free(type);
|
||||
free(state);
|
||||
free(*session_id);
|
||||
*session_id = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue