diff options
author | J William Piggott | 2015-04-21 22:43:41 +0200 |
---|---|---|
committer | J William Piggott | 2015-04-21 22:43:41 +0200 |
commit | efc4eaf4229f78f14430d8739ddef2c5101f05cc (patch) | |
tree | 76f6c827a72e703150729744c2954bc9b8977925 /sys-utils/hwclock-rtc.c | |
parent | sfdisk: don't use BLKRRPART to check loopdev usage (diff) | |
download | kernel-qcow2-util-linux-efc4eaf4229f78f14430d8739ddef2c5101f05cc.tar.gz kernel-qcow2-util-linux-efc4eaf4229f78f14430d8739ddef2c5101f05cc.tar.xz kernel-qcow2-util-linux-efc4eaf4229f78f14430d8739ddef2c5101f05cc.zip |
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 <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/hwclock-rtc.c')
-rw-r--r-- | sys-utils/hwclock-rtc.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 |