ecore_drm: use get_vt instead of parsing the tty attribute
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Mon, 30 Mar 2015 14:31:56 +0000 (10:31 -0400)
committerChris Michael <cp.michael@samsung.com>
Mon, 30 Mar 2015 14:41:03 +0000 (10:41 -0400)
Summary: logind has a seperate function to get the vt number.

@fix

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2252

src/lib/ecore_drm/ecore_drm_logind.c

index c590cf1..d45ded7 100644 (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