Skip to content

Commit

Permalink
8205959: Do not restart close if errno is EINTR
Browse files Browse the repository at this point in the history
Reviewed-by: serb
Backport-of: 45c5c6fda477c04eca1c8fdf9bdff7eab0535751
  • Loading branch information
gnu-andrew committed Feb 11, 2023
1 parent b71f59b commit fd41600
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jdk/src/solaris/native/java/net/linux_close.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -288,13 +288,13 @@ static int closefd(int fd1, int fd2) {
* And close/dup the file descriptor
* (restart if interrupted by signal)
*/
do {
if (fd1 < 0) {
rv = close(fd2);
} else {
if (fd1 < 0) {
rv = close(fd2);
} else {
do {
rv = dup2(fd1, fd2);
}
} while (rv == -1 && errno == EINTR);
} while (rv == -1 && errno == EINTR);
}

/*
* Send a wakeup signal to all threads blocked on this
Expand Down

1 comment on commit fd41600

@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.