From efc4eaf4229f78f14430d8739ddef2c5101f05cc Mon Sep 17 00:00:00 2001 From: J William Piggott Date: Tue, 21 Apr 2015 16:43:41 -0400 Subject: hwclock: regression fix Commit ab8f402952301106ad0bd5c5a51dc8646d1bff64 regression where synchronize_to_clock_tick_rtc() only returns the correct value for a select() time out if using debug mode. This caused hwclock to have invalid output when select() timed out in normal mode. Signed-off-by: J William Piggott --- sys-utils/hwclock-rtc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys-utils/hwclock-rtc.c') diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index 78f42aa4f..b5ecc5a3f 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -313,10 +313,11 @@ static int synchronize_to_clock_tick_rtc(void) if (rc == -1) warn(_("select() to %s to wait for clock tick failed"), rtc_dev_name); - else if (rc == 0 && debug) - printf(_("select() to %s to wait for clock tick timed out"), - rtc_dev_name); - else + else if (rc == 0) { + if (debug) + printf(_("select() to %s to wait for clock tick timed out"), + rtc_dev_name); + } else ret = 0; #endif -- cgit v1.2.3-55-g7522