|
@@ -108,9 +108,46 @@ const struct tm *tp;
|
|
|
}
|
|
|
|
|
|
|
|
|
-static time_t localtime_offset;
|
|
|
+
|
|
|
+ timezone given in the POSIX standard TZ envariable. */
|
|
|
+typedef struct
|
|
|
+ {
|
|
|
+ const char *name;
|
|
|
+
|
|
|
+
|
|
|
+ enum { J0, J1, M } type;
|
|
|
+ unsigned short int m, n, d;
|
|
|
+ unsigned int secs;
|
|
|
+
|
|
|
+ long int offset;
|
|
|
+
|
|
|
+
|
|
|
+ given year so we don't have to recompute it. */
|
|
|
+ time_t change;
|
|
|
+ int computed_for;
|
|
|
+ } tz_rule;
|
|
|
+
|
|
|
+
|
|
|
+static tz_rule tz_rules[2];
|
|
|
+
|
|
|
+
|
|
|
+ * no matter what it is given */
|
|
|
+void tzset (void)
|
|
|
+{
|
|
|
+ tz_rules[0].name = tz_rules[1].name = "UTC";
|
|
|
+ tz_rules[0].type = tz_rules[1].type = J0;
|
|
|
+ tz_rules[0].m = tz_rules[0].n = tz_rules[0].d = 0;
|
|
|
+ tz_rules[1].m = tz_rules[1].n = tz_rules[1].d = 0;
|
|
|
+ tz_rules[0].secs = tz_rules[1].secs = 0;
|
|
|
+ tz_rules[0].offset = tz_rules[1].offset = 0L;
|
|
|
+ tz_rules[0].change = tz_rules[1].change = (time_t) -1;
|
|
|
+ tz_rules[0].computed_for = tz_rules[1].computed_for = 0;
|
|
|
+}
|
|
|
|
|
|
|
|
|
+
|
|
|
+static time_t localtime_offset;
|
|
|
+
|
|
|
|
|
|
time_t mktime(tp)
|
|
|
struct tm *tp;
|
|
@@ -119,7 +156,7 @@ struct tm *tp;
|
|
|
|
|
|
time zone names contained in the external variable `tzname' shall
|
|
|
be set as if the tzset() function had been called. */
|
|
|
- __tzset();
|
|
|
+ tzset();
|
|
|
#endif
|
|
|
|
|
|
return __mktime_internal(tp, localtime_r, &localtime_offset);
|