|
@@ -401,9 +401,9 @@ char *ctime(const time_t *clock)
|
|
|
|
|
|
char *ctime_r(const time_t *clock, char *buf)
|
|
|
{
|
|
|
- struct tm xtms;
|
|
|
+ struct tm xtm;
|
|
|
|
|
|
- return asctime_r(localtime_r(clock, &xtms), buf);
|
|
|
+ return asctime_r(localtime_r(clock, &xtm), buf);
|
|
|
}
|
|
|
|
|
|
#endif
|
|
@@ -589,13 +589,12 @@ struct tm *localtime_r(register const time_t *__restrict timer,
|
|
|
*x = *timer + offset;
|
|
|
|
|
|
_time_t2tm(x, days, result);
|
|
|
-
|
|
|
- if (dst) {
|
|
|
- result->tm_isdst = dst;
|
|
|
- break;
|
|
|
- }
|
|
|
- ++dst;
|
|
|
- } while ((result->tm_isdst = tm_isdst(result)) != 0);
|
|
|
+ result->tm_isdst = dst;
|
|
|
+#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
|
|
|
+ result->tm_gmtoff = - _time_tzinfo[dst].gmt_offset;
|
|
|
+ strcpy( (char *)(result->tm_zone), _time_tzinfo[dst].tzname);
|
|
|
+#endif
|
|
|
+ } while ((++dst < 2) && (result->tm_isdst = tm_isdst(result)) != 0);
|
|
|
|
|
|
TZUNLOCK;
|
|
|
|
|
@@ -606,11 +605,16 @@ struct tm *localtime_r(register const time_t *__restrict timer,
|
|
|
|
|
|
#ifdef L_mktime
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+weak_alias(mktime,timelocal);
|
|
|
+
|
|
|
time_t mktime(struct tm *timeptr)
|
|
|
{
|
|
|
return _time_mktime(timeptr, 1);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
#ifdef L_strftime
|
|
@@ -1538,7 +1542,7 @@ static char *read_TZ_file(char *buf)
|
|
|
size_t todo;
|
|
|
char *p = NULL;
|
|
|
|
|
|
- if ((fd = open(_PATH_TZ, O_RDONLY)) >= 0) {
|
|
|
+ if ((fd = open("/etc/TZ", O_RDONLY)) >= 0) {
|
|
|
todo = TZ_BUFLEN;
|
|
|
p = buf;
|
|
|
do {
|
|
@@ -1612,7 +1616,7 @@ void tzset(void)
|
|
|
) || !*e) {
|
|
|
ILLEGAL:
|
|
|
#ifdef __TIME_TZ_OPT_SPEED
|
|
|
- *oldval = 0;
|
|
|
+ *oldval = 0;
|
|
|
#endif
|
|
|
s = _time_tzinfo[0].tzname;
|
|
|
*s = 'U';
|
|
@@ -1932,6 +1936,16 @@ struct tm *_time_t2tm(const time_t *__restrict timer,
|
|
|
}
|
|
|
|
|
|
p[4] = 0;
|
|
|
+#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
|
|
|
+ result->tm_gmtoff = 0;
|
|
|
+ {
|
|
|
+ register char *s = (char *) result->tm_zone;
|
|
|
+ *s = 'U';
|
|
|
+ *++s = 'T';
|
|
|
+ *++s = 'C';
|
|
|
+ *++s = 0;
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -2041,3 +2055,17 @@ time_t _time_mktime(struct tm *timeptr, int store_on_success)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
+#ifdef L_dysize
|
|
|
+
|
|
|
+
|
|
|
+int dysize(int year)
|
|
|
+{
|
|
|
+ return __isleap(year) ? 366 : 365;
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|