clearenv not on bsd - dont build the related test code (yes tests may
authorCarsten Haitzler <raster@rasterman.com>
Sun, 30 Jan 2011 10:50:14 +0000 (10:50 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sun, 30 Jan 2011 10:50:14 +0000 (10:50 +0000)
fail).

SVN revision: 56550

legacy/efreet/ChangeLog
legacy/efreet/configure.ac
legacy/efreet/src/tests/main.c

index fe01aca..db94316 100644 (file)
@@ -5,3 +5,7 @@
 2011-01-29  Brian Mattern
 
         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
index 173a6e5..bdb4d2d 100644 (file)
@@ -217,7 +217,7 @@ AC_SUBST(lt_enable_auto_import)
 ### Checks for library functions
 AC_ISC_POSIX
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(strlcpy)
+AC_CHECK_FUNCS(strlcpy clearenv)
 
 ### Unit tests, coverage
 
index f0093b0..0daa61a 100644 (file)
@@ -1,5 +1,6 @@
 #include "Efreet.h"
 #include "Efreet_Mime.h"
+#include "config.h"
 #include <Ecore.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -83,12 +84,12 @@ environment_store(void)
 {
     char *env;
     char **e;
-
+#ifdef HAVE_CLEARENV
     EINA_LIST_FREE(environment, env)
         free(env);
-
     for (e = environ; *e; e++)
         environment = eina_list_append(environment, strdup(*e));
+#endif   
 }
 
 void
@@ -97,10 +98,11 @@ environment_restore(void)
     Eina_List *l;
     char *e;
     if (!environment) return;
-
+#ifdef HAVE_CLEARENV
     clearenv();
     EINA_LIST_FOREACH(environment, l, e)
         putenv(e);
+#endif
 }
 
 int