about summary refs log tree commit diff
path: root/time/tzset.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/tzset.c')
-rw-r--r--time/tzset.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/time/tzset.c b/time/tzset.c
index d3a33dc1ce..a4fa8e358b 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -483,5 +483,19 @@ DEFUN(__tz_compute, (timer, tm),
 
   return 1;
 }
+
+#include <libc-lock.h>
+
+/* This locks all the state variables in tzfile.c and this file.  */
+__libc_lock_define (, __tzset_lock)
+
+/* Reinterpret the TZ environment variable and set `tzname'.  */
 
-weak_alias (__tzset, tzset)
+weak_symbol (tzset)
+void
+tzset (void)
+{
+  __libc_lock_lock (__tzset_lock);
+  __tzset ();
+  __libc_lock_unlock (__tzset_lock);
+}