log: quit using lrint and -lm

This commit is contained in:
Koichiro IWAO 2022-10-11 09:03:52 +09:00
parent aca05c4f2e
commit db96239982
2 changed files with 1 additions and 3 deletions

View File

@ -71,7 +71,6 @@ libcommon_la_SOURCES = \
$(PIXMAN_SOURCES)
libcommon_la_LIBADD = \
-lm \
-lpthread \
$(OPENSSL_LIBS) \
$(DLOPEN_LIBS)

View File

@ -24,7 +24,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <math.h>
#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
@ -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);