hwclock: fix wrong comparison of time value (when it will overlow int)
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Apr 2012 17:25:13 +0000 (19:25 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Apr 2012 17:25:13 +0000 (19:25 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/hwclock.c

index 6b4e29bfa141ba995ade371109def3c52680f8ef..379eeb25375db4dfc3f469db68864e4e9f8ad56f 100644 (file)
@@ -43,7 +43,7 @@ static time_t read_rtc(const char **pp_rtcname, struct timeval *sys_tv, int utc)
                while (1) {
                        rtc_read_tm(&tm_time, fd);
                        gettimeofday(sys_tv, NULL);
-                       if (before != tm_time.tm_sec)
+                       if (before != (int)tm_time.tm_sec)
                                break;
                }
        }