[git commit] ts: do call localtime() when neither -s nor -i specified

Denys Vlasenko vda.linux at googlemail.com
Tue Mar 26 10:51:21 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=fe78c9a8b727b0145fa93505cca621fe7962b9e9
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/ts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/ts.c b/miscutils/ts.c
index 4e1c7739f..f2d367654 100644
--- a/miscutils/ts.c
+++ b/miscutils/ts.c
@@ -69,8 +69,8 @@ int ts_main(int argc UNUSED_PARAM, char **argv)
 			}
 			if (opt & 1) /* -i */
 				base = ts1;
-			localtime_r(&ts.tv_sec, &tm_time);
 		}
+		localtime_r(&ts.tv_sec, &tm_time);
 		strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time);
 		if (!frac) {
 			printf("%s %s", date_buf, line);


More information about the busybox-cvs mailing list