From: cpickett Date: Wed, 31 Dec 2008 22:53:50 +0000 (+0000) Subject: * implement localtime_r X-Git-Tag: 0.10.0~653 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3d36d44c63e21b72a6c996a9dcf668def0603b3;p=check * implement localtime_r git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@511 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/lib/localtime_r.c b/lib/localtime_r.c index aaa5edf..65ea7bb 100644 --- a/lib/localtime_r.c +++ b/lib/localtime_r.c @@ -1,6 +1,16 @@ #include "libcompat.h" - -struct tm *localtime_r (const time_t *clock CK_ATTRIBUTE_UNUSED, struct tm *result CK_ATTRIBUTE_UNUSED) + +struct tm * +localtime_r (const time_t *clock, struct tm *result) { - return NULL; + struct tm *now = localtime (clock); + if (now == NULL) + { + return NULL; + } + else + { + *result = *now; + } + return result; }