diff options
author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2017-01-03 12:23:43 -0200 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2017-01-03 12:44:54 -0200 |
commit | 5e006baacfb5d95780eae5021324f9a6bf1710df (patch) | |
tree | b1177ade29d627955aed6cb1147649e9bd287c01 | |
parent | 806be7adc04ddfe9677e66116342762e093d80f9 (diff) | |
download | efl-5e006baacfb5d95780eae5021324f9a6bf1710df.tar.gz |
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.
-rw-r--r-- | src/lib/ecore_fb/ecore_fb.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/ecore_fb/ecore_fb.c b/src/lib/ecore_fb/ecore_fb.c index eec3904f67..d11225e79f 100644 --- a/src/lib/ecore_fb/ecore_fb.c +++ b/src/lib/ecore_fb/ecore_fb.c @@ -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; } |