< prev index next >

src/java.base/unix/native/libnio/ch/ServerSocketChannelImpl.c

Print this page
rev 50258 : [mq]: 8203369-Check-for-both-EAGAIN-and-EWOULDBLOCK-error-codes

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -101,11 +101,11 @@
         }
         /* ECONNABORTED => restart accept */
     }
 
     if (newfd < 0) {
-        if (errno == EAGAIN)
+        if (errno == EAGAIN || errno == EWOULDBLOCK)
             return IOS_UNAVAILABLE;
         if (errno == EINTR)
             return IOS_INTERRUPTED;
         JNU_ThrowIOExceptionWithLastError(env, "Accept failed");
         return IOS_THROWN;
< prev index next >