summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-04 02:14:20 +0200
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-04 02:23:52 +0200
commit223ba9acc3a50ca7bad9e33c1ece088464ee2a2f (patch)
tree80ce34b9f19789176454fcea0f4ed1e517c682ac /src/lib/ecore
parent768bb43ed3be2dd3fce9c5fe42ad7b5d0b477c90 (diff)
efl proc/exe envrion work again - after a break earlier on freebsd
efl seemingly has been broken on freebsd for a while - environ the symbol does not exist for SHARED LIBS on freebsd (discussin had been had on this already, but i gave up). use dlsym as the escape mechanism so we build on freebsd again.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_core_proc_env.c23
-rw-r--r--src/lib/ecore/efl_exe.c11
2 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/ecore/efl_core_proc_env.c b/src/lib/ecore/efl_core_proc_env.c
index 4c02821474..76f3bd1c0a 100644
--- a/src/lib/ecore/efl_core_proc_env.c
+++ b/src/lib/ecore/efl_core_proc_env.c
@@ -13,7 +13,12 @@
13 13
14#define MY_CLASS EFL_CORE_PROC_ENV_CLASS 14#define MY_CLASS EFL_CORE_PROC_ENV_CLASS
15 15
16#if defined (__FreeBSD__) || defined (__OpenBSD__)
17# include <dlfcn.h>
18static char ***_dl_environ;
19#else
16extern char **environ; 20extern char **environ;
21#endif
17 22
18static Efl_Core_Env *env = NULL; 23static Efl_Core_Env *env = NULL;
19 24
@@ -27,6 +32,7 @@ _sync(Efl_Core_Env *obj, Efl_Core_Proc_Env_Data *pd)
27 Eina_List *existing_keys = NULL, *n; 32 Eina_List *existing_keys = NULL, *n;
28 Eina_Iterator *content; 33 Eina_Iterator *content;
29 const char *key; 34 const char *key;
35 char **env = NULL;
30 36
31 pd->in_sync = EINA_TRUE; 37 pd->in_sync = EINA_TRUE;
32 content = efl_core_env_content_get(obj); 38 content = efl_core_env_content_get(obj);
@@ -36,11 +42,18 @@ _sync(Efl_Core_Env *obj, Efl_Core_Proc_Env_Data *pd)
36 existing_keys = eina_list_append(existing_keys, key); 42 existing_keys = eina_list_append(existing_keys, key);
37 } 43 }
38 44
39 if (environ) 45#if defined (__FreeBSD__) || defined (__OpenBSD__)
46 _dl_environ = dlsym(NULL, "environ");
47 if (_dl_environ) env = *_dl_environ;
48 else ERR("Can't find envrion symbol");
49#else
50 env = environ;
51#endif
52 if (env)
40 { 53 {
41 char **p; 54 char **p;
42 55
43 for (p = environ; *p; p++) 56 for (p = env; *p; p++)
44 { 57 {
45 char **values; 58 char **values;
46 59
@@ -104,7 +117,13 @@ _efl_core_proc_env_efl_core_env_clear(Eo *obj, Efl_Core_Proc_Env_Data *pd)
104#ifdef HAVE_CLEARENV 117#ifdef HAVE_CLEARENV
105 clearenv(); 118 clearenv();
106#else 119#else
120# if defined (__FreeBSD__) || defined (__OpenBSD__)
121 _dl_environ = dlsym(NULL, "environ");
122 if (_dl_environ) *_dl_environ = NULL;
123 else ERR("Can't find envrion symbol");
124# else
107 environ = NULL; 125 environ = NULL;
126# endif
108#endif 127#endif
109 } 128 }
110} 129}
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index b7cba7292f..75cba04404 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -30,7 +30,12 @@
30# include <sys/wait.h> 30# include <sys/wait.h>
31# endif 31# endif
32# ifndef HAVE_CLEARENV 32# ifndef HAVE_CLEARENV
33# if defined (__FreeBSD__) || defined (__OpenBSD__)
34# include <dlfcn.h>
35static char ***_dl_environ;
36# else
33extern char **environ; 37extern char **environ;
38# endif
34# endif 39# endif
35#endif 40#endif
36 41
@@ -579,7 +584,13 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
579# ifdef HAVE_CLEARENV 584# ifdef HAVE_CLEARENV
580 clearenv(); 585 clearenv();
581# else 586# else
587# if defined (__FreeBSD__) || defined (__OpenBSD__)
588 _dl_environ = dlsym(NULL, "environ");
589 if (_dl_environ) *_dl_environ = NULL;
590 else ERR("Can't find envrion symbol");
591# else
582 environ = NULL; 592 environ = NULL;
593# endif
583# endif 594# endif
584 itr = efl_core_env_content_get(pd->env); 595 itr = efl_core_env_content_get(pd->env);
585 596