aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2018-12-27 09:46:44 +0000
committerAlex Dupre <ale@FreeBSD.org>2018-12-27 09:46:44 +0000
commit848047809fc139c9df537e7ebedf4d9b5bbd9bc7 (patch)
treeb712614c4e97bf4330ccb69ec3627071a995ef96 /java
parentbe547fb0bb623145d4724ed64c7f63ab023ed7df (diff)
downloadports-848047809fc139c9df537e7ebedf4d9b5bbd9bc7.tar.gz
ports-848047809fc139c9df537e7ebedf4d9b5bbd9bc7.zip
Add support for millisecond resolution to get/setLastModifiedTime
in both Java IO and NIO.
Notes
Notes: svn path=/head/; revision=488521
Diffstat (limited to 'java')
-rw-r--r--java/openjdk8/Makefile2
-rw-r--r--java/openjdk8/files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c23
-rw-r--r--java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-fs-UnixNativeDispatcher.c11
3 files changed, 35 insertions, 1 deletions
diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile
index 1cebaa8ca9fa..b32d244c5b77 100644
--- a/java/openjdk8/Makefile
+++ b/java/openjdk8/Makefile
@@ -2,7 +2,7 @@
PORTNAME= openjdk
PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= java devel
MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${DIST_BUILD_NUMBER}/:jdk \
https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \
diff --git a/java/openjdk8/files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c b/java/openjdk8/files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c
new file mode 100644
index 000000000000..f5d0902cff92
--- /dev/null
+++ b/java/openjdk8/files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c
@@ -0,0 +1,23 @@
+--- jdk/src/solaris/native/java/io/UnixFileSystem_md.c.orig 2018-12-12 23:07:51.229721000 +0100
++++ jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2018-12-12 23:12:21.847169000 +0100
+@@ -208,7 +208,8 @@
+ WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
+ struct stat64 sb;
+ if (stat64(path, &sb) == 0) {
+- rv = 1000 * (jlong)sb.st_mtime;
++ rv = (jlong)sb.st_mtim.tv_sec * 1000;
++ rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
+ }
+ } END_PLATFORM_STRING(env, path);
+ return rv;
+@@ -392,8 +393,8 @@
+ struct timeval tv[2];
+
+ /* Preserve access time */
+- tv[0].tv_sec = sb.st_atime;
+- tv[0].tv_usec = 0;
++ tv[0].tv_sec = sb.st_atim.tv_sec;
++ tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
+
+ /* Change last-modified time */
+ tv[1].tv_sec = time / 1000;
diff --git a/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-fs-UnixNativeDispatcher.c b/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-fs-UnixNativeDispatcher.c
new file mode 100644
index 000000000000..5e44a53651d3
--- /dev/null
+++ b/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-fs-UnixNativeDispatcher.c
@@ -0,0 +1,11 @@
+--- ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c.orig 2018-12-13 10:02:37.501082000 +0100
++++ ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c 2018-12-13 10:06:26.825382000 +0100
+@@ -453,7 +453,7 @@
+ (*env)->SetLongField(env, attrs, attrs_st_birthtime_sec, (jlong)buf->st_birthtime);
+ #endif
+
+-#if (_POSIX_C_SOURCE >= 200809L) || defined(__solaris__)
++#if (_POSIX_C_SOURCE >= 200809L) || defined(__solaris__) || defined(__FreeBSD__)
+ (*env)->SetLongField(env, attrs, attrs_st_atime_nsec, (jlong)buf->st_atim.tv_nsec);
+ (*env)->SetLongField(env, attrs, attrs_st_mtime_nsec, (jlong)buf->st_mtim.tv_nsec);
+ (*env)->SetLongField(env, attrs, attrs_st_ctime_nsec, (jlong)buf->st_ctim.tv_nsec);