]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: remove FLOOR macro in favour of floor(3)
authorSami Kerola <kerolasa@iki.fi>
Sat, 16 Jul 2016 11:50:53 +0000 (12:50 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 4 Feb 2017 23:39:30 +0000 (23:39 +0000)
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/Makemodule.am
sys-utils/hwclock.c

index 88be83e8c98bae7fd387e0a8bca867b24aee88d1..be643c965c369c54e73bf81ed77e269fe458c4d3 100644 (file)
@@ -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
index 1d193a5dac218dcaa8535d8e592a5206f8c4a7e5..3cc425f9d413b68ad40409854918129c6e93f971 100644 (file)
@@ -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) {