From 4a6f658cb2a881832a4f38385452c427605057b9 Mon Sep 17 00:00:00 2001 From: J William Piggott Date: Mon, 31 Jul 2017 11:57:01 -0400 Subject: hwclock: remove busywait tristate return status The select() synchronization branch only returns success or fail. There is no reason for the busywait branch to do more. If synchronization fails for any reason then it must exit, otherwise all drift correction operation will be invalid. Signed-off-by: J William Piggott --- sys-utils/hwclock-rtc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sys-utils/hwclock-rtc.c') diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index a660e32ba..c50011aec 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -216,9 +216,8 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl, rtc_dev_name); } - rc = do_rtc_read_ioctl(rtc_fd, &start_time); - if (rc) - return RTC_BUSYWAIT_FAILED; + if (do_rtc_read_ioctl(rtc_fd, &start_time)) + return 1; /* * Wait for change. Should be within a second, but in case @@ -233,13 +232,13 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl, gettimeofday(&now, NULL); if (time_diff(now, begin) > 1.5) { warnx(_("Timed out waiting for time change.")); - return RTC_BUSYWAIT_TIMEOUT; + return 1; } } while (1); if (rc) - return RTC_BUSYWAIT_FAILED; - return RTC_BUSYWAIT_OK; + return 1; + return 0; } /* -- cgit v1.2.3-55-g7522