Re: adjtime without 3rd line: RTC is local or UTC?

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

 



On Sun, Feb 20, 2011 at 05:07:17PM +0000, Daniel Drake wrote:
> If there is no 3rd line present, rtcwake and hwclock have a
> disagreement over what the default is:
>
> rtcwake assumes UTC: main()
> 	if (clock_mode == CM_AUTO) {
> 		if (read_clock_mode() < 0) {
> 			printf(_("%s: assuming RTC uses UTC ...\n"),
> 					program_invocation_short_name);
> 			clock_mode = CM_UTC;
> 		}
> 	}
> 
> hwclock assumes local: hw_clock_is_utc()
> 	else
> 				/* get info from adjtime file - default is local */
> 		ret = (adjtime.local_utc == UTC);
> 
> 
> Which is the correct assumption?
> 
> I'm happy to fix this up. I'd vote that UTC is the more logical default to have.

 Yes, I agree. The kernel CONFIG_RTC_HCTOSYS also uses UTC.
 
 The problem is backward compatibility. People who depend on the
 current hwclock default will hate us :-) 

 Maybe we can add something like --rtc-default={local,utc} to the
 ./configure script and use UTC as a default.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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