"hwclock --systohc" and tick synchronization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We are looking at situations with OLPC XO laptops where all RTC power
has been lost and hence the system has lost its time/date and RTC
contents are invalid.

The usual thing to do in this case is to reset the system time to the
current moment and then use hwclock to save it to the RTC.

However, this is proving quite confusing.

# hwclock --systohc
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: No
such file or directory

Firstly, the corresponding warn() in hwclock-rtc.c should be warnx()
so that it does not print the errno message. When select returns 0
(timeout), interpreting errno does not make sense.

Secondly, did that hwclock command fail or succeed? Our users and a
developer saw that output and concluded "hwclock is broken" and filed
a bug. Having seen the bug report, I drew the same conclusion. Only
upon testing further I realised that this is only a warning and
hwclock did go on and set the RTC time appropriately.

So, can this message be silenced completely, or can we add a "RTC
successfully set from system clock"  success message that appears
afterwards?

Let me know if there is a preference, then I'll go and send a patch.

Thanks
Daniel
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux