discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=1fd9d8eee5fdf4d7e95b87989b91052da89d2993

commit 1fd9d8eee5fdf4d7e95b87989b91052da89d2993
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sat Mar 12 11:15:42 2016 -0500

    break out xwl init/shutdown into static functions for reuse internally
    
    calling modapi functions like this causes symbol collision and randomly
    calls corresponding functions for other modules
---
 src/modules/xwayland/e_mod_main.c | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/src/modules/xwayland/e_mod_main.c 
b/src/modules/xwayland/e_mod_main.c
index 5f28e1e..17e1f23 100644
--- a/src/modules/xwayland/e_mod_main.c
+++ b/src/modules/xwayland/e_mod_main.c
@@ -8,9 +8,9 @@
 
 EINTERN void dnd_init(void);
 EINTERN void dnd_shutdown(void);
-E_API int e_modapi_shutdown(E_Module *m EINA_UNUSED);
 
-E_API void *e_modapi_init(E_Module *m);
+static E_Module *xwl_init(E_Module *m);
+static void xwl_shutdown(void);
 
 /* local structures */
 typedef struct _E_XWayland_Server E_XWayland_Server;
@@ -259,8 +259,8 @@ static void
 xwayland_fatal(void *d EINA_UNUSED)
 {
    /* on xwayland fatal, attempt to restart it */
-   e_modapi_shutdown(NULL);
-   e_modapi_init(NULL);
+   xwl_shutdown();
+   xwl_init(NULL);
 }
 
 static void
@@ -343,11 +343,8 @@ error_dialog()
    return EINA_FALSE;
 }
 
-/* module functions */
-E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" };
-
-E_API void *
-e_modapi_init(E_Module *m)
+static E_Module *
+xwl_init(E_Module *m)
 {
    char disp[8];
 
@@ -417,16 +414,15 @@ e_modapi_init(E_Module *m)
    /* setup listener for SIGUSR1 */
    exs->sig_hdlr = 
      ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _cb_signal_event, exs);
-
    return m;
 }
 
-E_API int 
-e_modapi_shutdown(E_Module *m EINA_UNUSED)
+static void
+xwl_shutdown(void)
 {
    char path[256];
 
-   if (!exs) return 1;
+   if (!exs) return;
    dnd_shutdown();
 
    unlink(exs->lock);
@@ -444,6 +440,20 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
 
    free(exs);
    e_util_env_set("DISPLAY", NULL);
+}
 
+/* module functions */
+E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" };
+
+E_API void *
+e_modapi_init(E_Module *m)
+{
+   return xwl_init(m);
+}
+
+E_API int 
+e_modapi_shutdown(E_Module *m EINA_UNUSED)
+{
+   xwl_shutdown();
    return 1;
 }

-- 


Reply via email to