From 983ae185695f357f187a82a45fd5d8db920ab978 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 31 Oct 2010 19:21:53 -0400 Subject: [PATCH] * configure.in (checking whether localtime caches TZ): Use unsetenv instead of modifying environment directly. --- ChangeLog | 5 +++++ configure | 12 ++---------- configure.in | 12 ++---------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e6cd3d3deb..33a7cf784ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-31 Ken Brown + + * configure.in (checking whether localtime caches TZ): Use + unsetenv instead of modifying environment directly. + 2010-10-25 Andreas Schwab * configure.in (checking for -znocombreloc): Use AC_LANG_PROGRAM diff --git a/configure b/configure index c12401e2d16..3e3f91d4537 100755 --- a/configure +++ b/configure @@ -13982,14 +13982,6 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -extern char **environ; -unset_TZ () -{ - char **from, **to; - for (to = from = environ; (*to = *from); from++) - if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '=')) - to++; -} char TZ_GMT0[] = "TZ=GMT0"; char TZ_PST8[] = "TZ=PST8"; main() @@ -13999,13 +13991,13 @@ main() if (putenv (TZ_GMT0) != 0) exit (1); hour_GMT0 = localtime (&now)->tm_hour; - unset_TZ (); + unsetenv("TZ"); hour_unset = localtime (&now)->tm_hour; if (putenv (TZ_PST8) != 0) exit (1); if (localtime (&now)->tm_hour == hour_GMT0) exit (1); - unset_TZ (); + unsetenv("TZ"); if (localtime (&now)->tm_hour != hour_unset) exit (1); exit (0); diff --git a/configure.in b/configure.in index fb64f0b346a..d53830b5ba2 100644 --- a/configure.in +++ b/configure.in @@ -2952,14 +2952,6 @@ AC_MSG_CHECKING(whether localtime caches TZ) AC_CACHE_VAL(emacs_cv_localtime_cache, [if test x$ac_cv_func_tzset = xyes; then AC_TRY_RUN([#include -extern char **environ; -unset_TZ () -{ - char **from, **to; - for (to = from = environ; (*to = *from); from++) - if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '=')) - to++; -} char TZ_GMT0[] = "TZ=GMT0"; char TZ_PST8[] = "TZ=PST8"; main() @@ -2969,13 +2961,13 @@ main() if (putenv (TZ_GMT0) != 0) exit (1); hour_GMT0 = localtime (&now)->tm_hour; - unset_TZ (); + unsetenv("TZ"); hour_unset = localtime (&now)->tm_hour; if (putenv (TZ_PST8) != 0) exit (1); if (localtime (&now)->tm_hour == hour_GMT0) exit (1); - unset_TZ (); + unsetenv("TZ"); if (localtime (&now)->tm_hour != hour_unset) exit (1); exit (0); -- 2.39.5