ecore_fb: allow ecore_fb to not setup VT.

Some systems won't allow VT to be setup due permissions to KDSETMODE
to KD_GRAPHICS.

Introduce $ECORE_FB_NO_VT envvar to allow skip that setup.
This commit is contained in:
Gustavo Sverzut Barbieri 2017-01-03 12:23:43 -02:00
parent 806be7adc0
commit 5e006baacf
1 changed files with 16 additions and 4 deletions

View File

@ -41,11 +41,17 @@ nosigint(int val EINA_UNUSED)
EAPI int
ecore_fb_init(const char *name)
{
const char *s;
if (++_ecore_fb_init_count != 1)
return _ecore_fb_init_count;
if (!ecore_fb_vt_init())
return --_ecore_fb_init_count;
s = getenv("ECORE_FB_NO_VT");
if ((!s) || (atoi(s) == 0))
{
if (!ecore_fb_vt_init())
return --_ecore_fb_init_count;
}
if (!oldhand)
{
@ -69,6 +75,8 @@ ecore_fb_init(const char *name)
EAPI int
ecore_fb_shutdown(void)
{
const char *s;
if (--_ecore_fb_init_count != 0)
return _ecore_fb_init_count;
@ -77,8 +85,12 @@ ecore_fb_shutdown(void)
signal(SIGINT, oldhand);
oldhand = NULL;
}
ecore_fb_vt_shutdown();
s = getenv("ECORE_FB_NO_VT");
if ((!s) || (atoi(s) == 0))
{
ecore_fb_vt_shutdown();
}
return _ecore_fb_init_count;
}