aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-03-20 15:25:48 +0200
committerTimo Teräs <timo.teras@iki.fi>2017-03-21 08:15:29 +0200
commit1a4d299a0242a02aa0d4843dd9947d4187e70414 (patch)
tree524965445ca8c9eba7f425db6ffb2035d8025500 /main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch
parentc12931e8863fa9fddc90390db24a4a591f43043e (diff)
downloadaports-1a4d299a0242a02aa0d4843dd9947d4187e70414.tar.bz2
aports-1a4d299a0242a02aa0d4843dd9947d4187e70414.tar.xz
main/musl: cherry-pick upstream fixes
ldso changes (lazy emulation etc) are not stable yet, so it's are not included. the missing patch numbers are for those commits.
Diffstat (limited to 'main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch')
-rw-r--r--main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch b/main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch
new file mode 100644
index 0000000000..f3bcceb6dc
--- /dev/null
+++ b/main/musl/0029-fix-POSIX-format-TZ-dst-transition-times-for-souther.patch
@@ -0,0 +1,47 @@
+From dbff2bb889bc831599b022c49252c69bf48f4e4e Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Wed, 15 Mar 2017 20:27:38 -0400
+Subject: [PATCH] fix POSIX-format TZ dst transition times for southern
+ hemisphere
+
+the time of day at which daylight time switches over is specified in
+local time in the dst state prior to the transition. the code for
+handling this wrongly assumed it needed to switch whether dst or
+standard offset is applied to the transition time when the dst end
+date is before the dst start date (souther hemisphere summer), but in
+fact the end transition time should always be adjusted for dst, and
+the start transition time should always be adjusted for standard time.
+---
+ src/time/__tz.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/src/time/__tz.c b/src/time/__tz.c
+index 0e0c4ea2..ffe8d402 100644
+--- a/src/time/__tz.c
++++ b/src/time/__tz.c
+@@ -373,18 +373,14 @@ void __secs_to_zone(long long t, int local, int *isdst, long *offset, long *oppo
+ long long t0 = rule_to_secs(r0, y);
+ long long t1 = rule_to_secs(r1, y);
+
++ if (!local) {
++ t0 += __timezone;
++ t1 += dst_off;
++ }
+ if (t0 < t1) {
+- if (!local) {
+- t0 += __timezone;
+- t1 += dst_off;
+- }
+ if (t >= t0 && t < t1) goto dst;
+ goto std;
+ } else {
+- if (!local) {
+- t1 += __timezone;
+- t0 += dst_off;
+- }
+ if (t >= t1 && t < t0) goto std;
+ goto dst;
+ }
+--
+2.11.1
+