clearenv not on bsd - dont build the related test code (yes tests may

fail).



SVN revision: 56550
This commit is contained in:
Carsten Haitzler 2011-01-30 10:50:14 +00:00
parent b0531e0d36
commit debf4d9428
3 changed files with 10 additions and 4 deletions

View File

@ -5,3 +5,7 @@
2011-01-29 Brian Mattern 2011-01-29 Brian Mattern
Fix bug when you have an empty <Name></Name> in a menu Fix bug when you have an empty <Name></Name> in a menu
2011-01-30 Carsten Haitzler (The Rasterman)
Fix tests to not build clearenv related code if not available

View File

@ -217,7 +217,7 @@ AC_SUBST(lt_enable_auto_import)
### Checks for library functions ### Checks for library functions
AC_ISC_POSIX AC_ISC_POSIX
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_CHECK_FUNCS(strlcpy) AC_CHECK_FUNCS(strlcpy clearenv)
### Unit tests, coverage ### Unit tests, coverage

View File

@ -1,5 +1,6 @@
#include "Efreet.h" #include "Efreet.h"
#include "Efreet_Mime.h" #include "Efreet_Mime.h"
#include "config.h"
#include <Ecore.h> #include <Ecore.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -83,12 +84,12 @@ environment_store(void)
{ {
char *env; char *env;
char **e; char **e;
#ifdef HAVE_CLEARENV
EINA_LIST_FREE(environment, env) EINA_LIST_FREE(environment, env)
free(env); free(env);
for (e = environ; *e; e++) for (e = environ; *e; e++)
environment = eina_list_append(environment, strdup(*e)); environment = eina_list_append(environment, strdup(*e));
#endif
} }
void void
@ -97,10 +98,11 @@ environment_restore(void)
Eina_List *l; Eina_List *l;
char *e; char *e;
if (!environment) return; if (!environment) return;
#ifdef HAVE_CLEARENV
clearenv(); clearenv();
EINA_LIST_FOREACH(environment, l, e) EINA_LIST_FOREACH(environment, l, e)
putenv(e); putenv(e);
#endif
} }
int int