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

5 comments on commit 481c866

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 481c866 Apr 3, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-481c866d in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 481c866d from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 14 Mar 2024 and was reviewed by David Holmes and Serguei Spitsyn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-481c866d:backport-MBaesken-481c866d
$ git checkout backport-MBaesken-481c866d
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-481c866d

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk22u

@openjdk
Copy link

@openjdk openjdk bot commented on 481c866 Apr 3, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-481c866d in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 481c866d from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 14 Mar 2024 and was reviewed by David Holmes and Serguei Spitsyn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-MBaesken-481c866d:backport-MBaesken-481c866d
$ git checkout backport-MBaesken-481c866d
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-MBaesken-481c866d

Please sign in to comment.