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:
Marcel Hollerbach 2015-03-30 10:31:56 -04:00 committed by Chris Michael
parent bc9265f16d
commit 94299e2bfd
1 changed files with 2 additions and 14 deletions

View File

@ -12,27 +12,15 @@ static inline Eina_Bool
_ecore_drm_logind_vt_get(Ecore_Drm_Device *dev)
{
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)
{
ERR("Could not get systemd tty: %m");
return EINA_FALSE;
}
p = strchr(tty, 't');
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;
return EINA_TRUE;
}
#endif