]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: make RTC default to UTC time
authorDaniel Drake <dsd@laptop.org>
Mon, 21 Feb 2011 13:27:07 +0000 (13:27 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 21 Feb 2011 16:07:57 +0000 (17:07 +0100)
If /etc/adjtime doesn't specify UTC or LOCAL, rtcwake defaults to UTC
and hwclock defaults to LOCAL.

Switch hwclock to meet the behaviour of rtcwake (default=UTC), also
matching the kernel's CONFIG_RTC_HCTOSYS behaviour.

The user impact of this change should be minimal, as anyone who has run
"hwclock --systohc" before will have their UTC/LOCAL choice already
recorded in /etc/adjtime.

Signed-off-by: Daniel Drake <dsd@laptop.org>
hwclock/hwclock.8
hwclock/hwclock.c

index 31f769292601970e4f08208cc2be0fd41bb6ae4c..b693ae2b12fcb3f46f8eddfcfaa12916eb115516 100644 (file)
@@ -169,7 +169,7 @@ was used to set the clock (i.e. hwclock was successfully run with the
 or
 .B \-\-adjust
 options), as recorded in the adjtime file.  If the adjtime file doesn't
-exist, the default is local time.
+exist, the default is UTC time.
 
 .TP
 .B \-\-noadjfile
index 279b672f942f21bd902884a8525838c99b68a02a..88fb8a073279ce7c94211d05d77cc18e42165f81 100644 (file)
@@ -224,8 +224,8 @@ hw_clock_is_utc(const bool utc, const bool local_opt,
        else if (local_opt)
                ret = FALSE;    /* --localtime explicitly given */
        else
-                               /* get info from adjtime file - default is local */
-               ret = (adjtime.local_utc == UTC);
+                               /* get info from adjtime file - default is UTC */
+               ret = (adjtime.local_utc != LOCAL);
        if (debug)
                printf(_("Assuming hardware clock is kept in %s time.\n"),
                       ret ? _("UTC") : _("local"));