]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: fix DST end date in virtimetest timezones
authorLaine Stump <laine@laine.org>
Sun, 1 Jun 2014 02:21:19 +0000 (05:21 +0300)
committerLaine Stump <laine@laine.org>
Sun, 1 Jun 2014 02:21:19 +0000 (05:21 +0300)
commit83c41cebd92d04b27a4dcff7a44232ef200f6a65
tree1ec04e8b22841613fc6c307a3d479988fc1fd0c4
parentc7ca02e6e2086d118645b62ca63ed0b24f48ddf8
util: fix DST end date in virtimetest timezones

Reported by: Roman Bogorodskiy <bogorodskiy@gmail.com>

Some of the tests for virTimeLocalOffsetFromUTC set an imaginary
timezone that attempts to force dyalight savings time active all the
time by setting a start date of 0/00:00:00 and end date of
366/23:59:59. Since the day is 0-based, 366 really means "day 367"
which will never occur - this was an attempt to eliminate problems
with DST not being active in some cases right around midnight on
January 1. Even though it didn't completely solve the problem, it
didn't seem to cause harm so it was left in the test timezones.

Although Linux glibc doesn't mind having a DST end date of 366,
FreeBSD refuses to use such timezones, so the tests fail. This patch
changes the 366 to 365.

This may or may not cause failure of the remaining DST tests around
midnight Jan 1. If so, we will need to disable those tests at year's
end too.
tests/virtimetest.c