view patches/icedtea-use-system-tzdata.patch @ 858:d9fa5282ccde

2008-05-09 Lillian Angel <langel@redhat.com> * icedtea-use-system-tzdata.patch: Added missing lines to patch.
author Lillian Angel <langel@redhat.com>
date Fri, 09 May 2008 10:04:30 -0400
parents d86e9eb1fa7d
children
line wrap: on
line source

--- ../openjdkb23/openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java	2007-10-30 04:38:28.000000000 -0400
+++ openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java	2007-11-13 13:16:52.000000000 -0500
@@ -28,6 +28,7 @@
 import  java.io.File;
 import  java.io.FileInputStream;
 import  java.io.FileNotFoundException;
+import java.security.AccessControlException;
 import  java.io.IOException;
 import  java.lang.ref.SoftReference;
 import  java.security.AccessController;
@@ -1021,11 +1022,29 @@
         byte[] buffer = null;
 
         try {
-            String homeDir = AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction("java.home"));
-            final String fname = homeDir + File.separator + "lib" + File.separator
-                                 + "zi" + File.separator + fileName;
-            buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() {
+          String zi_dir = (String) AccessController.doPrivileged(new sun.security.action.GetPropertyAction("user.zoneinfo.dir"));
+           File dir = null;
+           if (zi_dir != null)
+             dir = new File(zi_dir);
+
+           // Some minimal sanity checking
+           if (dir != null) {
+             try {
+               File f = new File(dir, "ZoneInfoMappings");
+               if (!f.exists())
+                 dir = null;
+             } catch (AccessControlException ace) {
+               dir = null;
+             }
+           }
+
+           if (dir == null) {
+             String homeDir = (String) AccessController.doPrivileged(new sun.security.action.GetPropertyAction("java.home"));
+             zi_dir = homeDir + File.separator + "lib" + File.separator
+               + "zi";
+           }
+           final String fname =  zi_dir + File.separator + fileName;
+		buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws IOException {
                     File file = new File(fname);
                     if (!file.canRead()) {
--- oldopenjdk6/hotspot/src/os/linux/vm/os_linux.cpp	2008-03-26 05:07:22.000000000 -0400
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2008-05-08 11:03:17.000000000 -0400
@@ -376,6 +381,11 @@
     }
   }
 
+  SystemProperty* sp = Arguments::system_properties();
+  // Use the system zoneinfo files, if present
+  Arguments::PropertyList_add (&sp,
+                           "user.zoneinfo.dir", "/usr/share/javazi");
+
 #undef malloc
 #undef getenv
 #undef EXTENSIONS_DIR