From 4c18554694ea91b4bf5cfc8eb060255f7535b60a Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Wed, 26 Feb 2020 00:07:14 +0000 Subject: [PATCH] Ignore ECONNRESET when closing a socket See https://github.com/battleblow/openjdk-jdk11u/issues/94 for details --- java/openjdk11/Makefile | 1 + ...va.base_unix_native_libnio_ch_FileDispatcherImpl.c | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 java/openjdk11/files/patch-src_java.base_unix_native_libnio_ch_FileDispatcherImpl.c diff --git a/java/openjdk11/Makefile b/java/openjdk11/Makefile index e45cc8443f94..c8fe087efbb6 100644 --- a/java/openjdk11/Makefile +++ b/java/openjdk11/Makefile @@ -3,6 +3,7 @@ PORTNAME= openjdk DISTVERSIONPREFIX= jdk- DISTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} +PORTREVISION= 1 CATEGORIES= java devel PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} diff --git a/java/openjdk11/files/patch-src_java.base_unix_native_libnio_ch_FileDispatcherImpl.c b/java/openjdk11/files/patch-src_java.base_unix_native_libnio_ch_FileDispatcherImpl.c new file mode 100644 index 000000000000..49b642a29db2 --- /dev/null +++ b/java/openjdk11/files/patch-src_java.base_unix_native_libnio_ch_FileDispatcherImpl.c @@ -0,0 +1,11 @@ +--- src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c ++++ src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c +@@ -291,7 +291,7 @@ Java_sun_nio_ch_FileDispatcherImpl_release0(JNIEnv *env, jobject this, + static void closeFileDescriptor(JNIEnv *env, int fd) { + if (fd != -1) { + int result = close(fd); +- if (result < 0) ++ if (result < 0 && errno != ECONNRESET) + JNU_ThrowIOExceptionWithLastError(env, "Close failed"); + } + }