mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
define a dummy EPROTO for platforms that don't use it
This accomplishes the same thing as 2e2ef7fd in a potentially cleaner way.
This commit is contained in:
@@ -44,6 +44,11 @@
|
|||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// EPROTO is not used by OpenBSD and maybe other platforms.
|
||||||
|
#ifndef EPROTO
|
||||||
|
#define EPROTO 0
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace zmq
|
namespace zmq
|
||||||
{
|
{
|
||||||
const char *errno_to_string (int errno_);
|
const char *errno_to_string (int errno_);
|
||||||
|
|||||||
@@ -195,13 +195,8 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
|
|||||||
zmq_assert (s != retired_fd);
|
zmq_assert (s != retired_fd);
|
||||||
fd_t sock = ::accept (s, NULL, NULL);
|
fd_t sock = ::accept (s, NULL, NULL);
|
||||||
if (sock == -1) {
|
if (sock == -1) {
|
||||||
#ifdef EPROTO
|
|
||||||
#define OR_ERRNO_EQ_EPROTO || errno == EPROTO
|
|
||||||
#else
|
|
||||||
#define OR_ERRNO_EQ_EPROTO
|
|
||||||
#endif
|
|
||||||
errno_assert (errno == EAGAIN || errno == EWOULDBLOCK ||
|
errno_assert (errno == EAGAIN || errno == EWOULDBLOCK ||
|
||||||
errno == EINTR || errno == ECONNABORTED OR_ERRNO_EQ_EPROTO ||
|
errno == EINTR || errno == ECONNABORTED || errno == EPROTO ||
|
||||||
errno == ENFILE);
|
errno == ENFILE);
|
||||||
return retired_fd;
|
return retired_fd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,13 +262,8 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
|
|||||||
win_assert (brc);
|
win_assert (brc);
|
||||||
#else
|
#else
|
||||||
if (sock == -1) {
|
if (sock == -1) {
|
||||||
#ifdef EPROTO
|
|
||||||
#define OR_ERRNO_EQ_EPROTO || errno == EPROTO
|
|
||||||
#else
|
|
||||||
#define OR_ERRNO_EQ_EPROTO
|
|
||||||
#endif
|
|
||||||
errno_assert (errno == EAGAIN || errno == EWOULDBLOCK ||
|
errno_assert (errno == EAGAIN || errno == EWOULDBLOCK ||
|
||||||
errno == EINTR || errno == ECONNABORTED OR_ERRNO_EQ_EPROTO ||
|
errno == EINTR || errno == ECONNABORTED || errno == EPROTO ||
|
||||||
errno == ENOBUFS || errno == ENOMEM || errno == EMFILE ||
|
errno == ENOBUFS || errno == ENOMEM || errno == EMFILE ||
|
||||||
errno == ENFILE);
|
errno == ENFILE);
|
||||||
return retired_fd;
|
return retired_fd;
|
||||||
|
|||||||
Reference in New Issue
Block a user