diff options
author | nerdopolis <bluescreen_avenger@verizon.net> | 2020-09-18 11:44:23 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-09-18 11:48:19 +0200 |
commit | 57354e01ecdb52ab4399ee79d11ce3f72abcb087 (patch) | |
tree | a3aaa12cccdf20d1b299c80881a6c34474302477 | |
parent | 875f05cef53a973eee7fe25abdbcb824896f9d0e (diff) | |
download | efl-57354e01ecdb52ab4399ee79d11ce3f72abcb087.tar.gz |
call sd_seat_can_tty to determine if ttys should be used, instead of hard-coding seat0
Summary: All TTYs are on seat0, but not all seat0s have TTYs
Reviewers: #efl, devilhorns
Reviewed By: #efl, devilhorns
Subscribers: bu5hm4n, stefan_schmidt, raster, cedric, #reviewers, #committers
Tags: #efl
Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D12143
-rw-r--r-- | src/lib/elput/elput_logind.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 5182aefdbe..8a69da963f 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -21,6 +21,7 @@ static int (*_elput_sd_session_get_vt) (const char *session, unsigned *vtnr) = N static int (*_elput_sd_session_get_tty) (const char *session, char **display) = NULL; static int (*_elput_sd_pid_get_session) (pid_t pid, char **session) = NULL; static int (*_elput_sd_session_get_seat) (const char *session, char **seat) = NULL; +static int (*_elput_sd_seat_can_tty) (const char *seat) = NULL; void _elput_sd_init(void) @@ -91,14 +92,17 @@ _elput_sd_init(void) eina_module_symbol_get(_libsystemd, "sd_pid_get_session"); _elput_sd_session_get_seat = eina_module_symbol_get(_libsystemd, "sd_session_get_seat"); + _elput_sd_seat_can_tty = + eina_module_symbol_get(_libsystemd, "sd_seat_can_tty"); if (((!_elput_sd_session_get_vt) && (!_elput_sd_session_get_tty)) || (!_elput_sd_pid_get_session) || - (!_elput_sd_session_get_seat)) + (!_elput_sd_session_get_seat) || (!_elput_sd_seat_can_tty)) { _elput_sd_session_get_vt = NULL; _elput_sd_session_get_tty = NULL; _elput_sd_pid_get_session = NULL; _elput_sd_session_get_seat = NULL; + _elput_sd_seat_can_tty = NULL; eina_module_free(_libsystemd); _libsystemd = NULL; _libsystemd_broken = EINA_TRUE; @@ -631,7 +635,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty) goto seat_err; } - if ((seat) && (!strcmp(seat, "seat0"))) + if ((seat) && (_elput_sd_seat_can_tty(seat))) { if (!_logind_session_vt_get(em->sid, &em->vt_num)) { |