This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Look for zoneinfo files in Solaris directory


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
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]