Skip to content

Commit

Permalink
8327468: Do not restart close if errno is EINTR [macOS/linux]
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, sspitsyn
  • Loading branch information
MBaesken committed Mar 14, 2024
1 parent 44aef38 commit 481c866
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
6 changes: 2 additions & 4 deletions src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 481c866

Please sign in to comment.