summaryrefslogtreecommitdiffstats
path: root/contrib/file/src/ctime_r.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-06-26 06:03:39 +0000
committerdelphij <delphij@FreeBSD.org>2014-06-26 06:03:39 +0000
commitcd5514ba3b318b16aa00b1048bf9160a9f28fb35 (patch)
tree5b4f7850752944df750e0c678951b78d9484b67e /contrib/file/src/ctime_r.c
parent8b39363d0d5f3d274de63dac41aaba59cdf00cdb (diff)
parent02573f2d7154bbe159ba99728d5db9be8a29bd9b (diff)
downloadFreeBSD-src-cd5514ba3b318b16aa00b1048bf9160a9f28fb35.zip
FreeBSD-src-cd5514ba3b318b16aa00b1048bf9160a9f28fb35.tar.gz
MFV r267843: update file/libmagic to 5.19.
MFC after: 2 weeks
Diffstat (limited to 'contrib/file/src/ctime_r.c')
-rw-r--r--contrib/file/src/ctime_r.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/file/src/ctime_r.c b/contrib/file/src/ctime_r.c
new file mode 100644
index 0000000..ca7ad2f
--- /dev/null
+++ b/contrib/file/src/ctime_r.c
@@ -0,0 +1,19 @@
+/* $File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $ */
+
+#include "file.h"
+#ifndef lint
+FILE_RCSID("@(#)$File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $")
+#endif /* lint */
+#include <time.h>
+#include <string.h>
+
+/* ctime_r is not thread-safe anyway */
+char *
+ctime_r(const time_t *t, char *dst)
+{
+ char *p = ctime(t);
+ if (p == NULL)
+ return NULL;
+ memcpy(dst, p, 26);
+ return dst;
+}
OpenPOWER on IntegriCloud