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
This commit is contained in:
Seunghun Lee 2014-12-16 09:20:25 -05:00 committed by Chris Michael
parent 08d0137987
commit c280e2f711
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}
/**