mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-06 14:10:30 +08:00
(__tzfile_compute): Use negated value of offset for timezone
variable.
This commit is contained in:
parent
cac8e36b1b
commit
43fa95836b
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user