diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-12-11 01:18:33 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-12-11 01:18:33 +0000 |
commit | 50a824c82443d7861813622391b7c9599456d6de (patch) | |
tree | a64c84fadefd7b9a16e8069cafe6afad5b0aa12f /java/openjdk6/files/patch-set | |
parent | - Fix build with SDL enabled (diff) |
If /var/db/zoneinfo exists, use the file to determine timezone rather than
iterating over all files under /usr/share/zoneinfo. All supported FreeBSD
versions create the file with tzsetup(8). This change usually improves
java.util.TimeZone performance because we only need to test just one file.
Notes
Notes:
svn path=/head/; revision=336136
Diffstat (limited to 'java/openjdk6/files/patch-set')
-rw-r--r-- | java/openjdk6/files/patch-set | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/java/openjdk6/files/patch-set b/java/openjdk6/files/patch-set index 0dda615ac044..405fc9df13aa 100644 --- a/java/openjdk6/files/patch-set +++ b/java/openjdk6/files/patch-set @@ -11783,34 +11783,40 @@ #include <string.h> #include <dirent.h> #include <sys/stat.h> -@@ -49,7 +49,7 @@ +@@ -49,9 +49,13 @@ #define fileclose fclose #endif -#ifdef __linux__ +#if defined(__linux__) || defined(_ALLBSD_SOURCE) ++#ifdef __FreeBSD__ ++static const char *ETC_TIMEZONE_FILE = "/var/db/zoneinfo"; ++#else static const char *ETC_TIMEZONE_FILE = "/etc/timezone"; ++#endif static const char *ZONEINFO_DIR = "/usr/share/zoneinfo"; -@@ -199,7 +199,9 @@ + static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime"; + +@@ -199,7 +203,9 @@ int fd; char *buf; size_t size; + char zoneinfo_file[PATH_MAX+1]; -+#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) /* * Try reading the /etc/timezone file for Debian distros. There's * no spec of the file format available. This parsing assumes that -@@ -223,6 +225,7 @@ +@@ -223,6 +229,7 @@ return tz; } } -+#endif /* __linux__ */ ++#endif /* __linux__ || __FreeBSD__ */ /* * Next, try /etc/localtime to find the zone ID. -@@ -231,6 +234,9 @@ +@@ -231,6 +238,9 @@ return NULL; } @@ -11820,7 +11826,7 @@ /* * If it's a symlink, get the link name and its zone ID part. (The * older versions of timeconfig created a symlink as described in -@@ -239,21 +245,25 @@ +@@ -239,21 +249,25 @@ * from /etc/localtime.) */ if (S_ISLNK(statbuf.st_mode)) { @@ -11851,7 +11857,7 @@ /* * If it's a regular file, we need to find out the same zoneinfo file -@@ -264,7 +274,7 @@ +@@ -264,7 +278,7 @@ if (buf == NULL) { return NULL; } @@ -11860,7 +11866,7 @@ free((void *) buf); return NULL; } -@@ -493,7 +503,7 @@ +@@ -493,7 +507,7 @@ tz = getenv("TZ"); @@ -11869,7 +11875,7 @@ if (tz == NULL) { #else #ifdef __solaris__ -@@ -532,19 +542,32 @@ +@@ -532,19 +546,32 @@ { time_t offset; char sign, buf[16]; |