]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: regression fix
authorJ William Piggott <elseifthen@gmx.com>
Tue, 21 Apr 2015 20:43:41 +0000 (16:43 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Tue, 21 Apr 2015 20:43:41 +0000 (16:43 -0400)
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>
sys-utils/hwclock-rtc.c

index 78f42aa4f179ab3d7f2c08fee9cd21211f298ebc..b5ecc5a3fd54ddb84877c70df49dd70fdd06d306 100644 (file)
@@ -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