Merge pull request #3047 from acsearle/master

Allow EBADF on iOS #3046
This commit is contained in:
Luca Boccassi
2018-05-23 09:56:32 +01:00
committed by GitHub
4 changed files with 41 additions and 0 deletions

View File

@@ -51,6 +51,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
#endif
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
zmq::udp_engine_t::udp_engine_t (const options_t &options_) :
plugged (false),
fd (-1),
@@ -456,8 +460,13 @@ void zmq::udp_engine_t::in_event ()
int nbytes = recvfrom (fd, in_buffer, MAX_UDP_MSG, 0,
(sockaddr *) &in_address, &in_addrlen);
if (nbytes == -1) {
#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE
errno_assert (errno != EBADF && errno != EFAULT && errno != ENOMEM
&& errno != ENOTSOCK);
#else
errno_assert (errno != EBADF && errno != EFAULT && errno != ENOMEM
&& errno != ENOTSOCK);
#endif
return;
}
#endif