sys-utils/hwclock.h \
sys-utils/hwclock-cmos.c
if LINUX
-hwclock_SOURCES += sys-utils/hwclock-rtc.c
+hwclock_SOURCES += \
+ sys-utils/hwclock-rtc.c \
+ lib/monotonic.c
endif
hwclock_LDADD = $(LDADD) libcommon.la -lm
if HAVE_AUDIT
#include <time.h>
#include <unistd.h>
+#include "monotonic.h"
#include "nls.h"
#include "hwclock.h"
* something weird happens, we have a time limit (1.5s) on this loop
* to reduce the impact of this failure.
*/
- gettimeofday(&begin, NULL);
+ gettime_monotonic(&begin);
do {
rc = do_rtc_read_ioctl(rtc_fd, &nowtime);
if (rc || start_time.tm_sec != nowtime.tm_sec)
break;
- gettimeofday(&now, NULL);
+ gettime_monotonic(&now);
if (time_diff(now, begin) > 1.5) {
warnx(_("Timed out waiting for time change."));
return 1;