diff -r addda6247cb0 -r be1020446dd5 src/java.base/linux/native/libnet/linux_close.c --- a/src/java.base/linux/native/libnet/linux_close.c Thu Jun 28 10:05:43 2018 +0200 +++ b/src/java.base/linux/native/libnet/linux_close.c Thu Jun 28 01:10:09 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, 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 @@ -290,13 +290,13 @@ * 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