Summary: logind has a seperate function to get the vt number.
@fix
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2252
_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