[41651] trunk/base

afb at macports.org afb at macports.org
Sat Nov 8 01:33:02 PST 2008


Revision: 41651
          http://trac.macports.org/changeset/41651
Author:   afb at macports.org
Date:     2008-11-08 01:33:01 -0800 (Sat, 08 Nov 2008)
Log Message:
-----------
use clearenv(3) where available

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/src/config.h.in
    trunk/base/src/pextlib1.0/Pextlib.c

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2008-11-08 09:05:33 UTC (rev 41650)
+++ trunk/base/configure	2008-11-08 09:33:01 UTC (rev 41651)
@@ -8830,7 +8830,8 @@
 
 
 
-for ac_func in bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile
+
+for ac_func in bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2008-11-08 09:05:33 UTC (rev 41650)
+++ trunk/base/configure.ac	2008-11-08 09:33:01 UTC (rev 41651)
@@ -168,7 +168,7 @@
 AC_FUNC_CLOSEDIR_VOID
 AC_FUNC_FORK
 AC_FUNC_STRERROR_R
-AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile])
+AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv])
 MP_CHECK_READLINK_IS_P1003_1A
 
 AC_ARG_WITH(x11-prefix, [AC_HELP_STRING([--with-x11-prefix=PREFIX], [use PREFIX as the X11 base dir (default autodetect)])], [ x11prefix="$withval" ] )

Modified: trunk/base/src/config.h.in
===================================================================
--- trunk/base/src/config.h.in	2008-11-08 09:05:33 UTC (rev 41650)
+++ trunk/base/src/config.h.in	2008-11-08 09:33:01 UTC (rev 41651)
@@ -18,6 +18,9 @@
 /* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
+/* Define to 1 if you have the `clearenv' function. */
+#undef HAVE_CLEARENV
+
 /* Define to 1 if you have the `copyfile' function. */
 #undef HAVE_COPYFILE
 

Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c	2008-11-08 09:05:33 UTC (rev 41650)
+++ trunk/base/src/pextlib1.0/Pextlib.c	2008-11-08 09:33:01 UTC (rev 41651)
@@ -1149,6 +1149,7 @@
     }
 
     if (strcmp(name, "*") == 0) {
+#ifndef HAVE_CLEARENV
         /* unset all current environment variables; it'd be best to use
            clearenv() but that is not yet standardized, instead use Tcl's
            list capability to easily build an array of strings for each
@@ -1168,6 +1169,9 @@
             unsetenv(Tcl_GetString(listArray[loopCounter]));
         }
         Tcl_DecrRefCount( tclList );
+#else
+        clearenv();
+#endif
     } else {
         (void) unsetenv(name);
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081108/7af796db/attachment.html>


More information about the macports-changes mailing list