]> granicus.if.org Git - check/commitdiff
* implement localtime_r
authorcpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 31 Dec 2008 22:53:50 +0000 (22:53 +0000)
committercpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 31 Dec 2008 22:53:50 +0000 (22:53 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@511 64e312b2-a51f-0410-8e61-82d0ca0eb02a

lib/localtime_r.c

index aaa5edf472d1e7e6d15a54f0867a2a89a5199fcc..65ea7bb2ca708a8f453baca86b4688ae2abcfac5 100644 (file)
@@ -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;
 }