From: J William Piggott Date: Tue, 21 Apr 2015 20:43:41 +0000 (-0400) Subject: hwclock: regression fix X-Git-Tag: v2.27-rc1~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efc4eaf4229f78f14430d8739ddef2c5101f05cc;p=thirdparty%2Futil-linux.git 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 --- diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index 78f42aa4f1..b5ecc5a3fd 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