From: Karel Zak Date: Fri, 21 Sep 2012 10:05:12 +0000 (+0200) Subject: hwclock: wait time in hwclock is not long enough for some ARM devices X-Git-Tag: v2.23-rc1~689 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72fc8ca062f538413419f6b282827dbd5e6a7b06;p=thirdparty%2Futil-linux.git hwclock: wait time in hwclock is not long enough for some ARM devices On Sun, Sep 16, 2012 at 02:11:48PM +0800, Queen Adam wrote: > I'm using Archlinux ARM for my Melo A100 box. > The hwclock always timeout when using select() in rtc.c. > > After I change the timeout from 5 to 10, the problem is solved. > > In fact the timeout in my ARM box seems only to be a little larger > than 5s. Signed-off-by: Karel Zak --- diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index 3380941908..779051d85d 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -303,12 +303,12 @@ static int synchronize_to_clock_tick_rtc(void) struct timeval tv; /* - * Wait up to five seconds for the next update + * Wait up to ten seconds for the next update * interrupt */ FD_ZERO(&rfds); FD_SET(rtc_fd, &rfds); - tv.tv_sec = 5; + tv.tv_sec = 10; tv.tv_usec = 0; rc = select(rtc_fd + 1, &rfds, NULL, NULL, &tv); ret = 1;