summary refs log tree commit diff
path: root/time/tzset.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
commitdf4ef2ab9c0899b2670067cd97e58f7eb2913e00 (patch)
tree4cb343b5ba9ccdc9c0b96144412567b6a4eda0ee /time/tzset.c
parent6f9e7002f38ae778b3ff2f586a3e5766382228e9 (diff)
downloadglibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.gz
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.xz
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.zip
update from main archive 960105 cvs/libc-970107 cvs/libc-970106
Diffstat (limited to 'time/tzset.c')
-rw-r--r--time/tzset.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/time/tzset.c b/time/tzset.c
index 886ac6c0c8..13360b445b 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -77,15 +77,21 @@ static int compute_change __P ((tz_rule *rule, int year));
 static char *old_tz = NULL;
 
 /* Interpret the TZ envariable.  */
-void __tzset_internal __P ((void));
+void __tzset_internal __P ((int always));
 void
-__tzset_internal ()
+__tzset_internal (always)
+     int always;
 {
+  static int is_initialized = 0;
   register const char *tz;
   register size_t l;
   unsigned short int hh, mm, ss;
   unsigned short int whichrule;
 
+  if (is_initialized && !always)
+    return;
+  is_initialized = 1;
+
   /* Examine the TZ environment variable.  */
   tz = getenv ("TZ");
 
@@ -375,7 +381,7 @@ size_t __tzname_cur_max;
 long int
 __tzname_max ()
 {
-  __tzset_internal ();
+  __tzset_internal (0);
 
   return __tzname_cur_max;
 }
@@ -473,7 +479,7 @@ __tz_compute (timer, tm)
      time_t timer;
      const struct tm *tm;
 {
-  __tzset_internal ();
+  __tzset_internal (0);
 
   if (! compute_change (&tz_rules[0], 1900 + tm->tm_year) ||
       ! compute_change (&tz_rules[1], 1900 + tm->tm_year))
@@ -510,7 +516,7 @@ __tzset (void)
 {
   __libc_lock_lock (__tzset_lock);
 
-  __tzset_internal ();
+  __tzset_internal (1);
 
   if (!__use_tzfile)
     {