launcher-logind: Remove systemd-logind support
Many years ago (2014) systemd-logind was brought into libsystemd. We've supported old versions of systemd-logind ever since. Let's remove support for old versions of systemd-logind before the merge for a tiny code simplification. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
committed by
Daniel Stone
parent
66374d48f1
commit
83927bb0e6
@@ -695,29 +695,6 @@ launcher_logind_release_control(struct launcher_logind *wl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
weston_sd_session_get_vt(const char *sid, unsigned int *out)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_SYSTEMD_LOGIN_209
|
|
||||||
return sd_session_get_vt(sid, out);
|
|
||||||
#else
|
|
||||||
int r;
|
|
||||||
char *tty;
|
|
||||||
|
|
||||||
r = sd_session_get_tty(sid, &tty);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = sscanf(tty, "tty%u", out);
|
|
||||||
free(tty);
|
|
||||||
|
|
||||||
if (r != 1)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
launcher_logind_activate(struct launcher_logind *wl)
|
launcher_logind_activate(struct launcher_logind *wl)
|
||||||
{
|
{
|
||||||
@@ -803,7 +780,7 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *
|
|||||||
r = sd_seat_can_tty(t);
|
r = sd_seat_can_tty(t);
|
||||||
free(t);
|
free(t);
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
r = weston_sd_session_get_vt(wl->sid, &wl->vtnr);
|
r = sd_session_get_vt(wl->sid, &wl->vtnr);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
weston_log("logind: session not running on a VT\n");
|
weston_log("logind: session not running on a VT\n");
|
||||||
goto err_session;
|
goto err_session;
|
||||||
|
|||||||
@@ -156,13 +156,8 @@ endif
|
|||||||
systemd_dep = dependency('', required: false)
|
systemd_dep = dependency('', required: false)
|
||||||
if get_option('launcher-logind')
|
if get_option('launcher-logind')
|
||||||
systemd_dep = dependency('libsystemd', version: '>= 209', required: false)
|
systemd_dep = dependency('libsystemd', version: '>= 209', required: false)
|
||||||
if systemd_dep.found()
|
if not systemd_dep.found()
|
||||||
config_h.set('HAVE_SYSTEMD_LOGIN_209', '1')
|
error('logind support requires libsystemd >= 209. Or, you can use \'-Dlauncher-logind=false\'')
|
||||||
else
|
|
||||||
systemd_dep = dependency('libsystemd-login', version: '>= 198', required: false)
|
|
||||||
if not systemd_dep.found()
|
|
||||||
error('logind support requires libsystemd or libsystemd-login but neither was found. Or, you can use \'-Dlauncher-logind=false\'')
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dbus_dep = dependency('dbus-1', version: '>= 1.6', required: false)
|
dbus_dep = dependency('dbus-1', version: '>= 1.6', required: false)
|
||||||
|
|||||||
Reference in New Issue
Block a user