diff options
author | Seunghun Lee <shiin.lee@samsung.com> | 2014-12-16 09:20:25 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2014-12-16 09:20:42 -0500 |
commit | c280e2f71172273ab573a6965f294b53e5826ee3 (patch) | |
tree | 6d9f2f6e2ee13440e71ef432ab891b8bcc24eccb /src/lib/ecore_drm/ecore_drm_tty.c | |
parent | 08d01379878c40f4d2f717a6dafcb922c91b6bce (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
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_tty.c')
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_tty.c | 8 |
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; |
173 | err_setmode: | ||
174 | ioctl(dev->tty.fd, KDSETMODE, KD_TEXT); | ||
175 | err_kmode: | ||
176 | return EINA_FALSE; | ||
173 | } | 177 | } |
174 | 178 | ||
175 | /** | 179 | /** |