From patchwork Sat Jan 29 00:07:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libgo patch committed: Look for zoneinfo files in Solaris directory Date: Fri, 28 Jan 2011 14:07:58 -0000 From: Ian Taylor X-Patchwork-Id: 80908 Message-Id: To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com This patch changes libgo to look for zoneinfo files in the Solaris directory /usr/share/lib/zoneinfo if they are not found in the GNU/Linux, FreeBSD, Darwin directory /usr/share/zoneinfo. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 306be38bde46 libgo/go/time/zoneinfo_unix.go --- a/libgo/go/time/zoneinfo_unix.go Fri Jan 28 15:53:52 2011 -0800 +++ b/libgo/go/time/zoneinfo_unix.go Fri Jan 28 15:56:36 2011 -0800 @@ -18,6 +18,7 @@ const ( headerSize = 4 + 16 + 4*7 zoneDir = "/usr/share/zoneinfo/" + zoneDir2 = "/usr/share/lib/zoneinfo/" ) // Simple I/O interface to binary blob of data. @@ -216,7 +217,11 @@ case err == os.ENOENV: zones, _ = readinfofile("/etc/localtime") case len(tz) > 0: - zones, _ = readinfofile(zoneDir + tz) + var ok bool + zones, ok = readinfofile(zoneDir + tz) + if !ok { + zones, _ = readinfofile(zoneDir2 + tz) + } case len(tz) == 0: // do nothing: use UTC }