devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c280e2f71172273ab573a6965f294b53e5826ee3

commit c280e2f71172273ab573a6965f294b53e5826ee3
Author: Seunghun Lee <shiin....@samsung.com>
Date:   Tue Dec 16 09:20:25 2014 -0500

    ecore-drm: add error handling, when fail to setup tty.
    
    Summary: need to restore vt to text mode, when failed to setup.
    
    @fix
    
    Reviewers: devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1777
---
 src/lib/ecore_drm/ecore_drm_tty.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_drm/ecore_drm_tty.c 
b/src/lib/ecore_drm/ecore_drm_tty.c
index 5e85a03..11a074e 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -155,7 +155,7 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
         if (ioctl(dev->tty.fd, KDSETMODE, KD_GRAPHICS))
           {
              ERR("Could not set graphics mode: %m");
-             return EINA_FALSE;
+             goto err_kmode;
           }
      }
 
@@ -166,10 +166,14 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
    if (ioctl(dev->tty.fd, VT_SETMODE, &vtmode) < 0)
      {
         ERR("Could not set Terminal Mode: %m");
-        return EINA_FALSE;
+        goto err_setmode;
      }
 
    return EINA_TRUE;
+err_setmode:
+   ioctl(dev->tty.fd, KDSETMODE, KD_TEXT);
+err_kmode:
+   return EINA_FALSE;
 }
 
 /**

-- 


Reply via email to