8206145: dbgsysSocketClose - do not restart close if errno is EINTR [linux]
authormbaesken
Wed, 04 Jul 2018 16:54:56 +0200
changeset 50984 f1f4b8cd0192
parent 50983 66a808262d3b
child 50985 cd41f34e548c
8206145: dbgsysSocketClose - do not restart close if errno is EINTR [linux] Reviewed-by: alanb, stuefe
src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c
--- a/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c	Tue Jul 03 12:40:42 2018 +0200
+++ b/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c	Wed Jul 04 16:54:56 2018 +0200
@@ -145,9 +145,15 @@
 
 int dbgsysSocketClose(int fd) {
     int rv;
+
+    /* AIX recommends to repeat the close call on EINTR */
+#if defined(_AIX)
     do {
         rv = close(fd);
     } while (rv == -1 && errno == EINTR);
+#else
+    rv = close(fd);
+#endif
 
     return rv;
 }