summaryrefslogtreecommitdiff
path: root/lib/tzset.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-14 20:06:32 +0200
committerBruno Haible <bruno@clisp.org>2020-08-14 20:06:32 +0200
commit05486abf0559efa3764ae3fbe8f6fbe5f6322df8 (patch)
tree8f379df5a84caaf5bd29aac21ef4b2321df03ba2 /lib/tzset.c
parent5afb29f59a6f1764eb3059cc0485fb50202afea1 (diff)
downloadgnulib-05486abf0559efa3764ae3fbe8f6fbe5f6322df8.tar.gz
tzset: Assume the function exists.
* lib/time.in.h (tzset): Assume HAVE_TZSET is 1. * lib/tzset.c: Define rpl_tzset, not tzset. Assume HAVE_TZSET is 1. * modules/tzset (configure.ac): Don't test HAVE_TZSET. * m4/tzset.m4 (gl_FUNC_TZSET): Don't test for tzset. Don't set HAVE_TZSET. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Don't initialize HAVE_TZSET. * modules/time (Makefile.am): Don't substitute HAVE_TZSET.
Diffstat (limited to 'lib/tzset.c')
-rw-r--r--lib/tzset.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/tzset.c b/lib/tzset.c
index cd209e1949..681f0737a0 100644
--- a/lib/tzset.c
+++ b/lib/tzset.c
@@ -25,14 +25,8 @@
#include <stdlib.h>
#include <string.h>
-/* This is a wrapper for tzset, for systems on which tzset may clobber
- the static buffer used for localtime's result.
- Work around the bug in some systems whereby tzset clobbers the
- static buffer that localtime uses for its return value. The
- tzset function from Solaris 2.5, 2.5.1, and 2.6 has this problem. */
-
void
-tzset (void)
+rpl_tzset (void)
#undef tzset
{
#if defined _WIN32 && ! defined __CYGWIN__
@@ -66,9 +60,7 @@ tzset (void)
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-tzset>
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset> */
_tzset ();
-#elif HAVE_TZSET
- tzset ();
#else
- /* Do nothing. Avoid infinite recursion. */
+ tzset ();
#endif
}