summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2016-07-16 13:50:53 +0200
committerSami Kerola2017-02-05 00:39:30 +0100
commit1030c325c05b79f70a199464b05c72d3d383a9bc (patch)
treeb06e76c3c9ba776764c3ef9d4b07842b35cdf9e8
parentlib: add timegm() portability function to lib/timeutils.c (diff)
downloadkernel-qcow2-util-linux-1030c325c05b79f70a199464b05c72d3d383a9bc.tar.gz
kernel-qcow2-util-linux-1030c325c05b79f70a199464b05c72d3d383a9bc.tar.xz
kernel-qcow2-util-linux-1030c325c05b79f70a199464b05c72d3d383a9bc.zip
hwclock: remove FLOOR macro in favour of floor(3)
Reviewed-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--sys-utils/Makemodule.am2
-rw-r--r--sys-utils/hwclock.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
index 88be83e8c..be643c965 100644
--- a/sys-utils/Makemodule.am
+++ b/sys-utils/Makemodule.am
@@ -423,7 +423,7 @@ hwclock_SOURCES = \
if LINUX
hwclock_SOURCES += sys-utils/hwclock-rtc.c
endif
-hwclock_LDADD = $(LDADD) libcommon.la $(MATH_LIBS)
+hwclock_LDADD = $(LDADD) libcommon.la -lm
if HAVE_AUDIT
hwclock_LDADD += -laudit
endif
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 1d193a5da..3cc425f9d 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -92,8 +92,6 @@ static int hwaudit_on;
/* The struct that holds our hardware access routines */
struct clock_ops *ur;
-#define FLOOR(arg) ((arg >= 0 ? (int) arg : ((int) arg) - 1));
-
/* Maximal clock adjustment in seconds per day.
(adjtime() glibc call has 2145 seconds limit on i386, so it is good enough for us as well,
43219 is a maximal safe value preventing exact_adjustment overflow.) */
@@ -1068,7 +1066,7 @@ calculate_adjustment(const double factor,
exact_adjustment =
((double)(systime - last_time)) * factor / (24 * 60 * 60)
+ not_adjusted;
- tdrift_p->tv_sec = FLOOR(exact_adjustment);
+ tdrift_p->tv_sec = (time_t) floor(exact_adjustment);
tdrift_p->tv_usec = (exact_adjustment -
(double)tdrift_p->tv_sec) * 1E6;
if (debug) {