From db962399821d833aaf5c4bc46fca88e8112766e4 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Tue, 11 Oct 2022 09:03:52 +0900 Subject: [PATCH] log: quit using lrint and -lm --- common/Makefile.am | 1 - common/log.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index f8adc3ff4c..c929baab19 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -71,7 +71,6 @@ libcommon_la_SOURCES = \ $(PIXMAN_SOURCES) libcommon_la_LIBADD = \ - -lm \ -lpthread \ $(OPENSSL_LIBS) \ $(DLOPEN_LIBS) diff --git a/common/log.c b/common/log.c index 69eabf562a..5c0a0ec71f 100644 --- a/common/log.c +++ b/common/log.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -1158,7 +1157,7 @@ getFormattedDateTime(char *replybuf, int bufsize) gettimeofday(&tv, NULL); now = localtime(&tv.tv_sec); - millisec = lrint(tv.tv_usec / 1000.0); + millisec = (tv.tv_usec + 500 / 1000); g_snprintf(buf_millisec, sizeof(buf_millisec), "%03d", millisec); strftime(buf_datetime, sizeof(buf_datetime), "%FT%T.", now);