From 481c866df87c693a90a1da20e131e5654b084ddd Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 14 Mar 2024 08:01:39 +0000 Subject: [PATCH] 8327468: Do not restart close if errno is EINTR [macOS/linux] Reviewed-by: dholmes, sspitsyn --- src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c | 3 +-- src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c b/src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c index 3aec395a1ba2c..fc9af9018352b 100644 --- a/src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c +++ b/src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c @@ -192,9 +192,8 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_checkPermissions JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close (JNIEnv *env, jclass cls, jint fd) { - int res; shutdown(fd, SHUT_RDWR); - RESTARTABLE(close(fd), res); + close(fd); } /* diff --git a/src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c b/src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c index 4e5b2aad6952a..d77d9e416f2f3 100644 --- a/src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c +++ b/src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c @@ -194,9 +194,8 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_checkPermissions JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close (JNIEnv *env, jclass cls, jint fd) { - int res; shutdown(fd, SHUT_RDWR); - RESTARTABLE(close(fd), res); + close(fd); } /* @@ -288,8 +287,7 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_createAttachFile } RESTARTABLE(chown(_path, geteuid(), getegid()), rc); - - RESTARTABLE(close(fd), rc); + close(fd); /* release p here */ if (isCopy) {