forked from enlightenment/efl
ecore_drm: use get_vt instead of parsing the tty attribute
Summary: logind has a seperate function to get the vt number. @fix Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2252
This commit is contained in:
parent
bc9265f16d
commit
94299e2bfd
|
@ -12,27 +12,15 @@ static inline Eina_Bool
|
||||||
_ecore_drm_logind_vt_get(Ecore_Drm_Device *dev)
|
_ecore_drm_logind_vt_get(Ecore_Drm_Device *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char *tty, *p;
|
|
||||||
|
|
||||||
ret = sd_session_get_tty(dev->session, &tty);
|
ret = sd_session_get_vt(dev->session, &dev->vt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
ERR("Could not get systemd tty: %m");
|
ERR("Could not get systemd tty: %m");
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = strchr(tty, 't');
|
return EINA_TRUE;
|
||||||
dev->vt = UINT_MAX;
|
|
||||||
if (p)
|
|
||||||
{
|
|
||||||
while (p[0] && (!isdigit(p[0])))
|
|
||||||
p++;
|
|
||||||
if (p[0])
|
|
||||||
dev->vt = strtoul(p, NULL, 10);
|
|
||||||
}
|
|
||||||
free(tty);
|
|
||||||
|
|
||||||
return dev->vt != UINT_MAX;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue