about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-19 23:54:38 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-19 23:54:38 +0000
commit43fa95836b580039ccb92c97cbbe52ac210936bf (patch)
tree09da2bac7b05a9682517a6a65ebf2c1b1094c315
parentcac8e36b1b04562477d6d8c87b2ce9916d2392de (diff)
downloadglibc-43fa95836b580039ccb92c97cbbe52ac210936bf.tar.gz
glibc-43fa95836b580039ccb92c97cbbe52ac210936bf.tar.xz
glibc-43fa95836b580039ccb92c97cbbe52ac210936bf.zip
(__tzfile_compute): Use negated value of offset for timezone
variable.
-rw-r--r--time/tzfile.c2
-rw-r--r--time/tzset.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index 9289de63a0..dff80dad9b 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -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)
diff --git a/time/tzset.c b/time/tzset.c
index 6ec4e15a86..f651c3f7ac 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -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
 	{