diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-02-23 19:08:58 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-02-23 19:08:58 +0000 |
commit | 6b9a74f9e625e8e4d96e325b959ebead48e4a192 (patch) | |
tree | 40ba541db2e02522847b1e3f91746bb75ebc5078 /newlib/libc/time/strftime.c | |
parent | 3a021c19f42cfcbc585de089966c279e665592bc (diff) | |
download | cygnal-6b9a74f9e625e8e4d96e325b959ebead48e4a192.tar.gz cygnal-6b9a74f9e625e8e4d96e325b959ebead48e4a192.tar.bz2 cygnal-6b9a74f9e625e8e4d96e325b959ebead48e4a192.zip |
2005-02-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/time.h [!CYGWIN](_timezone): Change to long.
(__tzrule_type, __tzinfo_type): New types.
(__gettzinfo): New function.
* libc/sys/linux/include/time.h: Ditto.
* libc/time/Makefile.am: Add gettzinfo.c.
* libc/time/Makefile.in: Regenerated.
* libc/time/local.h: Moved __tzrule_type to time.h.
* libc/time/mktime.c: Call __gettzinfo to reference
__tznorth, __tzyear, and __tzrule array.
* libc/time/mktm_r.c: Ditto.
* libc/time/strftime.c: Ditto.
* libc/time/tzset_r.c: Ditto. Also remove definition
of __tzrule which is now in gettzinfo.c. Change _timezone
references to not cast to time_t.
* libc/time/gettzinfo.c: New file.
Diffstat (limited to 'newlib/libc/time/strftime.c')
-rw-r--r-- | newlib/libc/time/strftime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 28b00eeab..395f8f3d8 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -757,11 +757,12 @@ _DEFUN (strftime, (s, maxsize, format, tim_p), if (count < maxsize - 5) { int offset; + __tzinfo_type *tz = __gettzinfo (); TZ_LOCK; /* The sign of this is exactly opposite the envvar TZ. We could directly use the global _timezone for tm_isdst==0, but have to use __tzrule for daylight savings. */ - offset = -__tzrule[tim_p->tm_isdst > 0].offset; + offset = -tz->__tzrule[tim_p->tm_isdst > 0].offset; TZ_UNLOCK; sprintf (&s[count], "%+03ld%.2d", offset / SECSPERHOUR, abs (offset / SECSPERMIN) % 60); |