Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-24 01:17:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-02-24 01:17:28 +0300
commitd0578adf88c42217f497701271faa2573a37e910 (patch)
tree46b0184059ba00bda9c7665d053dd8e6954d360f
parentee8d935cdd0efec63ea93bd88ab990bb4083f3f6 (diff)
* localtime.cc: Implement setting __tzrule's offset member using
newlib's __gettzinfo () interface. (__tzrule): Remove. (timezone): Define as long according to POSIX.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/localtime.cc36
2 files changed, 20 insertions, 23 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 151501961..076b0ea31 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * localtime.cc: Implement setting __tzrule's offset member using
+ newlib's __gettzinfo () interface.
+ (__tzrule): Remove.
+ (timezone): Define as long according to POSIX.
+
2005-02-23 Eric Blake <ebb9@byu.net>
* devices.in (parsedisk): Fix typo.
diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc
index c956b0405..aba2f7b79 100644
--- a/winsup/cygwin/localtime.cc
+++ b/winsup/cygwin/localtime.cc
@@ -629,28 +629,14 @@ static struct tm tm;
#undef _daylight
#ifdef USG_COMPAT
-time_t timezone;
-int daylight;
+long timezone; /* was time_t but POSIX requires long. */
+int daylight;
#endif /* defined USG_COMPAT */
#ifdef ALTZONE
-time_t altzone;
+time_t altzone;
#endif /* defined ALTZONE */
-/* Must be equivalent to definiton in newlib/libc/time/local.h */
-typedef struct __tzrule_struct
-{
- char ch;
- int m;
- int n;
- int d;
- int s;
- time_t change;
- int offset;
-} __tzrule_type;
-__tzrule_type __tzrule[2] = { {'J', 0, 0, 0, 0, (time_t)0, 0 },
- {'J', 0, 0, 0, 0, (time_t)0, 0 } };
-
static long
detzcode(const char *codep)
{
@@ -1249,8 +1235,10 @@ tzparse(const char *name, struct state *sp, const int lastditch)
janfirst += year_lengths[isleap(year)] *
SECSPERDAY;
}
- __tzrule[0].offset = -sp->ttis[1].tt_gmtoff;
- __tzrule[1].offset = -sp->ttis[0].tt_gmtoff;
+ __gettzinfo ()->__tzrule[0].offset
+ = -sp->ttis[1].tt_gmtoff;
+ __gettzinfo ()->__tzrule[1].offset
+ = -sp->ttis[0].tt_gmtoff;
} else {
register long theirstdoffset;
register long theirdstoffset;
@@ -1337,8 +1325,10 @@ tzparse(const char *name, struct state *sp, const int lastditch)
sp->ttis[1].tt_isdst = true;
sp->ttis[1].tt_abbrind = stdlen + 1;
sp->typecnt = 2;
- __tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
- __tzrule[1].offset = -sp->ttis[1].tt_gmtoff;
+ __gettzinfo ()->__tzrule[0].offset
+ = -sp->ttis[0].tt_gmtoff;
+ __gettzinfo ()->__tzrule[1].offset
+ = -sp->ttis[1].tt_gmtoff;
}
} else {
dstlen = 0;
@@ -1347,8 +1337,8 @@ tzparse(const char *name, struct state *sp, const int lastditch)
sp->ttis[0].tt_gmtoff = -stdoffset;
sp->ttis[0].tt_isdst = 0;
sp->ttis[0].tt_abbrind = 0;
- __tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
- __tzrule[1].offset = -sp->ttis[0].tt_gmtoff;
+ __gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
+ __gettzinfo ()->__tzrule[1].offset = -sp->ttis[0].tt_gmtoff;
}
sp->charcnt = stdlen + 1;
if (dstlen != 0)