src/java.base/unix/native/libnet/PlainSocketImpl.c
changeset 50275 69204b98dc3d
parent 49431 5812849b5027
child 53422 6f02e036630e
--- a/src/java.base/unix/native/libnet/PlainSocketImpl.c	Fri May 25 11:59:01 2018 -0700
+++ b/src/java.base/unix/native/libnet/PlainSocketImpl.c	Fri May 25 12:44:34 2018 -0700
@@ -630,8 +630,8 @@
      * before accept() was called.
      *
      * If accept timeout in place and timeout is adjusted with
-     * each ECONNABORTED or EWOULDBLOCK to ensure that semantics
-     * of timeout are preserved.
+     * each ECONNABORTED or EWOULDBLOCK or EAGAIN to ensure that
+     * semantics of timeout are preserved.
      */
     for (;;) {
         int ret;
@@ -673,12 +673,12 @@
             break;
         }
 
-        /* non (ECONNABORTED or EWOULDBLOCK) error */
-        if (!(errno == ECONNABORTED || errno == EWOULDBLOCK)) {
+        /* non (ECONNABORTED or EWOULDBLOCK or EAGAIN) error */
+        if (!(errno == ECONNABORTED || errno == EWOULDBLOCK || errno == EAGAIN)) {
             break;
         }
 
-        /* ECONNABORTED or EWOULDBLOCK error so adjust timeout if there is one. */
+        /* ECONNABORTED or EWOULDBLOCK or EAGAIN error so adjust timeout if there is one. */
         if (nanoTimeout >= NET_NSEC_PER_MSEC) {
             currNanoTime = JVM_NanoTime(env, 0);
             nanoTimeout -= (currNanoTime - prevNanoTime);