summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-12-11 01:18:33 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-12-11 01:18:33 +0000
commit50a824c82443d7861813622391b7c9599456d6de (patch)
treea64c84fadefd7b9a16e8069cafe6afad5b0aa12f /java
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')
-rw-r--r--java/openjdk6-jre/Makefile2
-rw-r--r--java/openjdk6/Makefile2
-rw-r--r--java/openjdk6/files/patch-set26
3 files changed, 18 insertions, 12 deletions
diff --git a/java/openjdk6-jre/Makefile b/java/openjdk6-jre/Makefile
index 6e946bb69acf..e4b23891c21f 100644
--- a/java/openjdk6-jre/Makefile
+++ b/java/openjdk6-jre/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= java devel
PKGNAMESUFFIX= -jre
diff --git a/java/openjdk6/Makefile b/java/openjdk6/Makefile
index 3d82a95dc75e..28feb2c96cfb 100644
--- a/java/openjdk6/Makefile
+++ b/java/openjdk6/Makefile
@@ -3,7 +3,7 @@
PORTNAME= openjdk6
PORTVERSION= b28
-PORTREVISION?= 6
+PORTREVISION?= 7
CATEGORIES= java devel
MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \
http://download.java.net/openjdk/jtreg/promoted/4.1/b05/:jtreg \
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];