]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__tzfile_compute): Use negated value of offset for timezone
authorUlrich Drepper <drepper@redhat.com>
Wed, 19 Nov 1997 23:54:38 +0000 (23:54 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 19 Nov 1997 23:54:38 +0000 (23:54 +0000)
variable.

time/tzfile.c
time/tzset.c

index 9289de63a04c2517ac30f1db4396cf20b4747b25..dff80dad9b3bf3baa6f041f4767e790664b2f150 100644 (file)
@@ -420,7 +420,7 @@ __tzfile_compute (time_t timer, int use_localtime,
     {
       struct ttinfo *info = find_transition (timer);
       __daylight = info->isdst;
-      __timezone = info->offset;
+      __timezone = -info->offset;
       for (i = 0;
           i < num_types && i < sizeof (__tzname) / sizeof (__tzname[0]);
           ++i)
index 6ec4e15a86c8ab8ce6eb6bb38694bf6ac8f3f552..f651c3f7ac6cd4e9ddd9b358735d8716a583b1af 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <ctype.h>
 #include <errno.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -543,7 +543,7 @@ tz_compute (timer, tm)
     return 0;
 
   __daylight = timer >= tz_rules[0].change && timer < tz_rules[1].change;
-  __timezone = tz_rules[__daylight ? 1 : 0].offset;
+  __timezone = -tz_rules[__daylight].offset;
   __tzname[0] = (char *) tz_rules[0].name;
   __tzname[1] = (char *) tz_rules[1].name;
 
@@ -624,7 +624,7 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
        {
          tp->tm_isdst = __daylight;
          tp->tm_zone = __tzname[__daylight];
-         tp->tm_gmtoff = __timezone;
+         tp->tm_gmtoff = -__timezone;
        }
       else
        {