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

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

 



Hi,

Fedora's initscripts package installs /etc/adjtime with these 2 lines only:

  0.0 0 0.0
  0

In util-linux, both hwclock and rtcwake read /etc/adjtime to determine
if the system clock is set as the local time, or as UTC time. They
look at the 3rd line, not present in Fedora's default shipped version.

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.

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