diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 06:56:40 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-20 19:14:03 +0200 |
commit | 0739e40da6b3bdde0c331f0ec060a68cc8e9963c (patch) | |
tree | e5961f0347c0f67ecb3595a70068202c06f80d1a /win32 | |
parent | df414e9d639a8c1253cfb6225609e22eed91150a (diff) | |
download | busybox-w32-0739e40da6b3bdde0c331f0ec060a68cc8e9963c.tar.gz busybox-w32-0739e40da6b3bdde0c331f0ec060a68cc8e9963c.tar.bz2 busybox-w32-0739e40da6b3bdde0c331f0ec060a68cc8e9963c.zip |
win32: add localtime_r()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 1a476651a..9ce7bc3ff 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -69,3 +69,10 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) | |||
69 | memcpy(result, gmtime(timep), sizeof(struct tm)); | 69 | memcpy(result, gmtime(timep), sizeof(struct tm)); |
70 | return result; | 70 | return result; |
71 | } | 71 | } |
72 | |||
73 | struct tm *localtime_r(const time_t *timep, struct tm *result) | ||
74 | { | ||
75 | /* localtime() in MSVCRT.DLL is thread-safe, but not reentrant */ | ||
76 | memcpy(result, localtime(timep), sizeof(struct tm)); | ||
77 | return result; | ||
78 | } | ||