summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghun Lee <shiin.lee@samsung.com>2014-12-16 09:20:25 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-16 09:20:42 -0500
commitc280e2f71172273ab573a6965f294b53e5826ee3 (patch)
tree6d9f2f6e2ee13440e71ef432ab891b8bcc24eccb
parent08d01379878c40f4d2f717a6dafcb922c91b6bce (diff)
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
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c8
1 files 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 5e85a03a71..11a074e0d6 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)
155 if (ioctl(dev->tty.fd, KDSETMODE, KD_GRAPHICS)) 155 if (ioctl(dev->tty.fd, KDSETMODE, KD_GRAPHICS))
156 { 156 {
157 ERR("Could not set graphics mode: %m"); 157 ERR("Could not set graphics mode: %m");
158 return EINA_FALSE; 158 goto err_kmode;
159 } 159 }
160 } 160 }
161 161
@@ -166,10 +166,14 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
166 if (ioctl(dev->tty.fd, VT_SETMODE, &vtmode) < 0) 166 if (ioctl(dev->tty.fd, VT_SETMODE, &vtmode) < 0)
167 { 167 {
168 ERR("Could not set Terminal Mode: %m"); 168 ERR("Could not set Terminal Mode: %m");
169 return EINA_FALSE; 169 goto err_setmode;
170 } 170 }
171 171
172 return EINA_TRUE; 172 return EINA_TRUE;
173err_setmode:
174 ioctl(dev->tty.fd, KDSETMODE, KD_TEXT);
175err_kmode:
176 return EINA_FALSE;
173} 177}
174 178
175/** 179/**