Skip to content

Commit

Permalink
log: quit using lrint and -lm
Browse files Browse the repository at this point in the history
  • Loading branch information
metalefty committed Oct 11, 2022
1 parent aca05c4 commit db96239
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ libcommon_la_SOURCES = \
$(PIXMAN_SOURCES)

libcommon_la_LIBADD = \
-lm \
-lpthread \
$(OPENSSL_LIBS) \
$(DLOPEN_LIBS)
3 changes: 1 addition & 2 deletions common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit db96239

Please sign in to comment.