From 6d8c62429cf9606827d2cf2925b9bf26a878a4b5 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 27 Jun 2014 18:41:19 +0000 Subject: Implement current and signal methods for sun.nio.ch.NativeThread. Note this fixes a test case in the following Apache Solr bug report. https://issues.apache.org/jira/browse/SOLR-6204 Reported by: Dawid Weiss --- java/openjdk6/Makefile | 2 +- java/openjdk6/files/patch-set | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) (limited to 'java/openjdk6') diff --git a/java/openjdk6/Makefile b/java/openjdk6/Makefile index 6b2b0ac61109..6b0b1bf285b2 100644 --- a/java/openjdk6/Makefile +++ b/java/openjdk6/Makefile @@ -3,7 +3,7 @@ PORTNAME= openjdk6 PORTVERSION= b31 -PORTREVISION?= 3 +PORTREVISION?= 4 PORTEPOCH= 1 CATEGORIES= java devel MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \ diff --git a/java/openjdk6/files/patch-set b/java/openjdk6/files/patch-set index 555841a7e064..8703d9006f70 100644 --- a/java/openjdk6/files/patch-set +++ b/java/openjdk6/files/patch-set @@ -14576,6 +14576,57 @@ +#ifdef __cplusplus +} +#endif +--- jdk/src/solaris/native/sun/nio/ch/NativeThread.c ++++ jdk/src/solaris/native/sun/nio/ch/NativeThread.c +@@ -33,12 +33,20 @@ + #include "nio_util.h" + + +-#ifdef __linux__ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) ++#if defined(__linux__) + #include + #include + + /* Also defined in src/solaris/native/java/net/linux_close.c */ + #define INTERRUPT_SIGNAL (__SIGRTMAX - 2) ++#else ++#include ++#include ++ ++/* Also defined in src/solaris/native/java/net/bsd_close.c */ ++#define INTERRUPT_SIGNAL SIGIO ++#endif + + static void + nullHandler(int sig) +@@ -51,7 +59,7 @@ + JNIEXPORT void JNICALL + Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl) + { +-#ifdef __linux__ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) + + /* Install the null handler for INTERRUPT_SIGNAL. This might overwrite the + * handler previously installed by java/net/linux_close.c, but that's okay +@@ -74,7 +82,7 @@ + JNIEXPORT jlong JNICALL + Java_sun_nio_ch_NativeThread_current(JNIEnv *env, jclass cl) + { +-#ifdef __linux__ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) + return (long)pthread_self(); + #else + return -1; +@@ -84,7 +92,7 @@ + JNIEXPORT void JNICALL + Java_sun_nio_ch_NativeThread_signal(JNIEnv *env, jclass cl, jlong thread) + { +-#ifdef __linux__ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) + if (pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL)) + JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed"); + #endif --- jdk/src/solaris/native/sun/nio/ch/Net.c +++ jdk/src/solaris/native/sun/nio/ch/Net.c @@ -65,17 +65,33 @@ -- cgit v1.2.3