]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: Incorrect UTC defaults
authorJWP <elseifthen@gmx.com>
Thu, 8 Jan 2015 04:15:39 +0000 (23:15 -0500)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Jan 2015 09:44:02 +0000 (10:44 +0100)
commitbf6199673bbca046ceed59002004eb1c1aebaca1
tree0fab308b2c598c945ef9e3612e75fb58693ddc0b
parentcfb8ed1910677bd096dee8404a9e03d5e59ef357
hwclock: Incorrect UTC defaults

Hwclock's default timescale was changed to UTC in:

commit 7894bf0f08740f75610990a2ba76af7a7cbce61e
Date:   Mon Feb 21 13:27:07 2011 +0000

This change was incomplete.

With no /etc/adjtime file the current behavior is:
hwclock --utc --adjust        #Creates a UTC file.
hwclock --localtime --adjust  #File is not created.

That is the opposite of what UTC default should do.

With this patch the behavior is:
hwclock --utc --adjust        #File is not created.
hwclock --localtime --adjust  #Creates a LOCAL file.

'Creates a xxxx file' means: An /etc/adjtime file
is created with zero for all parameters except the
Hardware Clock's timescale field, which is set to
the value indicated by xxxx.

The second item missed in the patch was a test in
the save_adjtime() function that defaults to LOCAL.

Theoretically we cannot get to the save function
without having a value set for adjtime.local_utc,
but the test is there so it needs be correct.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock.c