8327468: Do not restart close if errno is EINTR [macOS/linux]

Reviewed-by: dholmes, sspitsyn
This commit is contained in:
Matthias Baesken 2024-03-14 08:01:39 +00:00
parent 44aef38623
commit 481c866df8
2 changed files with 3 additions and 6 deletions

View File

@ -192,9 +192,8 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_checkPermissions
JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close
(JNIEnv *env, jclass cls, jint fd) (JNIEnv *env, jclass cls, jint fd)
{ {
int res;
shutdown(fd, SHUT_RDWR); shutdown(fd, SHUT_RDWR);
RESTARTABLE(close(fd), res); close(fd);
} }
/* /*

View File

@ -194,9 +194,8 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_checkPermissions
JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close JNIEXPORT void JNICALL Java_sun_tools_attach_VirtualMachineImpl_close
(JNIEnv *env, jclass cls, jint fd) (JNIEnv *env, jclass cls, jint fd)
{ {
int res;
shutdown(fd, SHUT_RDWR); 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(chown(_path, geteuid(), getegid()), rc);
close(fd);
RESTARTABLE(close(fd), rc);
/* release p here */ /* release p here */
if (isCopy) { if (isCopy) {