summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authornerdopolis <bluescreen_avenger@verizon.net>2020-09-18 11:44:23 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-09-18 11:48:19 +0200
commit57354e01ecdb52ab4399ee79d11ce3f72abcb087 (patch)
treea3aaa12cccdf20d1b299c80881a6c34474302477 /src/lib
parent875f05cef53a973eee7fe25abdbcb824896f9d0e (diff)
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
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elput/elput_logind.c8
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
21static int (*_elput_sd_session_get_tty) (const char *session, char **display) = NULL; 21static int (*_elput_sd_session_get_tty) (const char *session, char **display) = NULL;
22static int (*_elput_sd_pid_get_session) (pid_t pid, char **session) = NULL; 22static int (*_elput_sd_pid_get_session) (pid_t pid, char **session) = NULL;
23static int (*_elput_sd_session_get_seat) (const char *session, char **seat) = NULL; 23static int (*_elput_sd_session_get_seat) (const char *session, char **seat) = NULL;
24static int (*_elput_sd_seat_can_tty) (const char *seat) = NULL;
24 25
25void 26void
26_elput_sd_init(void) 27_elput_sd_init(void)
@@ -91,14 +92,17 @@ _elput_sd_init(void)
91 eina_module_symbol_get(_libsystemd, "sd_pid_get_session"); 92 eina_module_symbol_get(_libsystemd, "sd_pid_get_session");
92 _elput_sd_session_get_seat = 93 _elput_sd_session_get_seat =
93 eina_module_symbol_get(_libsystemd, "sd_session_get_seat"); 94 eina_module_symbol_get(_libsystemd, "sd_session_get_seat");
95 _elput_sd_seat_can_tty =
96 eina_module_symbol_get(_libsystemd, "sd_seat_can_tty");
94 if (((!_elput_sd_session_get_vt) && (!_elput_sd_session_get_tty)) || 97 if (((!_elput_sd_session_get_vt) && (!_elput_sd_session_get_tty)) ||
95 (!_elput_sd_pid_get_session) || 98 (!_elput_sd_pid_get_session) ||
96 (!_elput_sd_session_get_seat)) 99 (!_elput_sd_session_get_seat) || (!_elput_sd_seat_can_tty))
97 { 100 {
98 _elput_sd_session_get_vt = NULL; 101 _elput_sd_session_get_vt = NULL;
99 _elput_sd_session_get_tty = NULL; 102 _elput_sd_session_get_tty = NULL;
100 _elput_sd_pid_get_session = NULL; 103 _elput_sd_pid_get_session = NULL;
101 _elput_sd_session_get_seat = NULL; 104 _elput_sd_session_get_seat = NULL;
105 _elput_sd_seat_can_tty = NULL;
102 eina_module_free(_libsystemd); 106 eina_module_free(_libsystemd);
103 _libsystemd = NULL; 107 _libsystemd = NULL;
104 _libsystemd_broken = EINA_TRUE; 108 _libsystemd_broken = EINA_TRUE;
@@ -631,7 +635,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
631 goto seat_err; 635 goto seat_err;
632 } 636 }
633 637
634 if ((seat) && (!strcmp(seat, "seat0"))) 638 if ((seat) && (_elput_sd_seat_can_tty(seat)))
635 { 639 {
636 if (!_logind_session_vt_get(em->sid, &em->vt_num)) 640 if (!_logind_session_vt_get(em->sid, &em->vt_num))
637 { 641 {