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
Backport-of: 481c866df87c693a90a1da20e131e5654b084ddd
  • Loading branch information
MBaesken committed Apr 5, 2024
1 parent bdf5747 commit b80fb5e
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 @@ -198,9 +198,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 @@ -200,9 +200,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 @@ -294,8 +293,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

1 comment on commit b80fb5e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.