1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Add timezone support.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-05-16 15:51:43 +02:00
parent eb00186be1
commit 1940d9560e
2 changed files with 9 additions and 5 deletions

View file

@ -130,12 +130,8 @@ strtold.o \
strxfrm.o \
time/asctime.o \
time/asctime_r.o \
time/ctime.o \
time/ctime_r.o \
time/gmtime.o \
time/gmtime_r.o \
time/localtime.o \
time/localtime_r.o \
time/mktime.o \
timespec.o \
time/strftime.o \
@ -359,7 +355,11 @@ time/clock_nanosleep.o \
time/clock.o \
time/clock_settime.o \
time/clock_settimeres.o \
time/ctime.o \
time/ctime_r.o \
time/difftime.o \
time/localtime.o \
time/localtime_r.o \
time/nanosleep.o \
time/timens.o \
time/time.o \

View file

@ -26,5 +26,9 @@
extern "C" struct tm* localtime_r(const time_t* time_ptr, struct tm* ret)
{
return gmtime_r(time_ptr, ret);
struct tm utc_tm;
if ( !gmtime_r(time_ptr, &utc_tm) )
return NULL;
*ret = utc_tm;
return ret;
}