summaryrefslogtreecommitdiffstats
path: root/common/sys/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/sys/time.c')
-rw-r--r--common/sys/time.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/common/sys/time.c b/common/sys/time.c
index 3031d445..5cf20dc1 100644
--- a/common/sys/time.c
+++ b/common/sys/time.c
@@ -115,6 +115,14 @@ ctime4(const time4_t *clock)
return ctime(&temp);
}
+char *
+ctime4_r(const time4_t *t, char *buf)
+{
+ time_t temp = (time_t)*t;
+
+ return ctime_r(&temp, buf);
+}
+
// XXX TODO change this to localtime_r style someday.
struct tm *localtime4(const time4_t *t)
{
@@ -148,16 +156,3 @@ time4_t time4(time4_t *ptr)
return *ptr = (time4_t)time(NULL);
}
#endif
-
-const char*
-my_ctime(const time4_t * t, char *ans, int len)
-{
- time_t temp = (time_t)*clock;
- struct tm tp;
-
- localtime_r(&temp, &tp);
- snprintf(ans, len,
- "%02d/%02d/%02d %02d:%02d:%02d", (tp.tm_year % 100),
- tp.tm_mon + 1, tp.tm_mday, tp.tm_hour, tp.tm_min, tp.tm_sec);
- return ans;
-}