< prev index next >

src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c

Print this page
rev 13048 : 8203369: Check for both EAGAIN and EWOULDBLOCK error codes
Reviewed-by: alanb

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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

@@ -438,11 +438,11 @@
     msg->msg_controllen = sizeof(cbuf);
     msg->msg_flags = 0;
 
     do {
         if ((rv = recvmsg(fd, msg, flags)) < 0) {
-            if (errno == EWOULDBLOCK) {
+            if (errno == EAGAIN || errno == EWOULDBLOCK) {
                 return IOS_UNAVAILABLE;
             } else if (errno == EINTR) {
                 return IOS_INTERRUPTED;
 
 #ifdef __linux__

@@ -583,11 +583,11 @@
     cdata->unordered = unordered;
     cdata->ppid = ppid;
     setControlData(msg, cdata);
 
     if ((rv = sendmsg(fd, msg, 0)) < 0) {
-        if (errno == EWOULDBLOCK) {
+        if (errno == EAGAIN || errno == EWOULDBLOCK) {
             return IOS_UNAVAILABLE;
         } else if (errno == EINTR) {
             return IOS_INTERRUPTED;
         } else if (errno == EPIPE) {
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
< prev index next >