aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/ts.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/miscutils/ts.c b/miscutils/ts.c
index f2d367654..f769d663b 100644
--- a/miscutils/ts.c
+++ b/miscutils/ts.c
@@ -22,6 +22,9 @@ int ts_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
22int ts_main(int argc UNUSED_PARAM, char **argv) 22int ts_main(int argc UNUSED_PARAM, char **argv)
23{ 23{
24 struct timeval base; 24 struct timeval base;
25#if ENABLE_PLATFORM_MINGW32 && !defined(_USE_32BIT_TIME_T)
26 time_t t;
27#endif
25 unsigned opt; 28 unsigned opt;
26 char *frac; 29 char *frac;
27 char *fmt_dt2str; 30 char *fmt_dt2str;
@@ -70,7 +73,12 @@ int ts_main(int argc UNUSED_PARAM, char **argv)
70 if (opt & 1) /* -i */ 73 if (opt & 1) /* -i */
71 base = ts1; 74 base = ts1;
72 } 75 }
76#if ENABLE_PLATFORM_MINGW32 && !defined(_USE_32BIT_TIME_T)
77 t = ts.tv_sec;
78 localtime_r(&t, &tm_time);
79#else
73 localtime_r(&ts.tv_sec, &tm_time); 80 localtime_r(&ts.tv_sec, &tm_time);
81#endif
74 strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time); 82 strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time);
75 if (!frac) { 83 if (!frac) {
76 printf("%s %s", date_buf, line); 84 printf("%s %s", date_buf, line);