src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c
changeset 50275 69204b98dc3d
parent 47216 71c04702a3d5
child 53445 c96f9aa1f3d8
equal deleted inserted replaced
50274:33a890c972c3 50275:69204b98dc3d
     1 /*
     1 /*
     2  * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   437     msg->msg_controllen = sizeof(cbuf);
   437     msg->msg_controllen = sizeof(cbuf);
   438     msg->msg_flags = 0;
   438     msg->msg_flags = 0;
   439 
   439 
   440     do {
   440     do {
   441         if ((rv = recvmsg(fd, msg, flags)) < 0) {
   441         if ((rv = recvmsg(fd, msg, flags)) < 0) {
   442             if (errno == EWOULDBLOCK) {
   442             if (errno == EAGAIN || errno == EWOULDBLOCK) {
   443                 return IOS_UNAVAILABLE;
   443                 return IOS_UNAVAILABLE;
   444             } else if (errno == EINTR) {
   444             } else if (errno == EINTR) {
   445                 return IOS_INTERRUPTED;
   445                 return IOS_INTERRUPTED;
   446 
   446 
   447 #ifdef __linux__
   447 #ifdef __linux__
   580     cdata->unordered = unordered;
   580     cdata->unordered = unordered;
   581     cdata->ppid = ppid;
   581     cdata->ppid = ppid;
   582     setControlData(msg, cdata);
   582     setControlData(msg, cdata);
   583 
   583 
   584     if ((rv = sendmsg(fd, msg, 0)) < 0) {
   584     if ((rv = sendmsg(fd, msg, 0)) < 0) {
   585         if (errno == EWOULDBLOCK) {
   585         if (errno == EAGAIN || errno == EWOULDBLOCK) {
   586             return IOS_UNAVAILABLE;
   586             return IOS_UNAVAILABLE;
   587         } else if (errno == EINTR) {
   587         } else if (errno == EINTR) {
   588             return IOS_INTERRUPTED;
   588             return IOS_INTERRUPTED;
   589         } else if (errno == EPIPE) {
   589         } else if (errno == EPIPE) {
   590             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
   590             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",