]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: make hwclock leap-second-aware
authorJoseph Parmelee <jparmele@wildbear.com>
Mon, 18 Mar 2013 04:48:57 +0000 (22:48 -0600)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Mar 2013 09:31:32 +0000 (10:31 +0100)
commitd53f8ecfbf036eddb2aef737dc0973a613d80ced
tree8530b3f24f23de976a01fbaec92e2693f2fbcebe
parent52848780e3b6721dead7b40629594798e0d37fb9
hwclock: make hwclock leap-second-aware

Attached is a patch file leap_seconds.patch against util-linux-2.22.2
that allows leap seconds to be included in hwclock --show or --hctosys.
The current code uses the default UTC zonefile in reading the hardware
RTC with mktime().  This zonefile usually does not include leap
seconds.  As of this date there have been a total of 25 leap seconds
added since the epoch (start of 1970).  This is particularly a problem
for systems using ntp to maintain their system clocks because ntp does
take leap seconds into account.  A user can specify a leap-second-aware
zonefile via /etc/localtime.  By defining the environment variable
TZUTC, mktime() can be induced to use a matching UTC zonefile that
includes leap seconds.  The default behavior (TZUTC undefined) is
unchanged.

Regards,

Joseph Parmelee
jparmele at wildbear.com
sys-utils/hwclock.c