summaryrefslogtreecommitdiff
path: root/src/time/zoneinfo_read.go
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2018-11-02 10:55:12 +0100
committerIan Lance Taylor <iant@golang.org>2018-11-02 13:44:27 +0000
commitbd4b6ca781e7e82580620011f8af2a7f11c5c239 (patch)
tree6ba233e594fa5e4b412a9ae7b6eac4848af638e9 /src/time/zoneinfo_read.go
parent5ee06f547122b7417b70ada55bb0d633e2094d88 (diff)
downloadgo-git-bd4b6ca781e7e82580620011f8af2a7f11c5c239.tar.gz
all: fix tests for older versions of AIX 7.2
This commit fixes tests which fail on some versions of AIX 7.2 due to internal bugs. getsockname isn't working properly with unix networks. Timezone files aren't returning a correct output. Change-Id: I4ff15683912be62ab86dfbeeb63b73513404d086 Reviewed-on: https://go-review.googlesource.com/c/146940 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/time/zoneinfo_read.go')
-rw-r--r--src/time/zoneinfo_read.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go
index 15d6aab1de..b495217c06 100644
--- a/src/time/zoneinfo_read.go
+++ b/src/time/zoneinfo_read.go
@@ -11,6 +11,7 @@ package time
import (
"errors"
+ "runtime"
"syscall"
)
@@ -172,6 +173,14 @@ func LoadLocationFromTZData(name string, data []byte) (*Location, error) {
return nil, badData
}
zone[i].name = byteString(abbrev[b:])
+ if runtime.GOOS == "aix" && len(name) > 8 && (name[:8] == "Etc/GMT+" || name[:8] == "Etc/GMT-") {
+ // There is a bug with AIX 7.2 TL 0 with files in Etc,
+ // GMT+1 will return GMT-1 instead of GMT+1 or -01.
+ if name != "Etc/GMT+0" {
+ // GMT+0 is OK
+ zone[i].name = name[4:]
+ }
+ }
}
// Now the transition time info.