mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-06 03:19:00 +08:00
On systems where getifaddrs() exists but isn't implemented, behave as if 'resolve_nic_name()' were entirely unsupported
This commit is contained in:
parent
9a5036409d
commit
b1e2b87f0f
@ -183,6 +183,14 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
|
|||||||
// Get the addresses.
|
// Get the addresses.
|
||||||
ifaddrs *ifa = NULL;
|
ifaddrs *ifa = NULL;
|
||||||
const int rc = getifaddrs (&ifa);
|
const int rc = getifaddrs (&ifa);
|
||||||
|
if (rc != 0 && errno == EINVAL) {
|
||||||
|
// Windows Subsystem for Linux compatibility
|
||||||
|
LIBZMQ_UNUSED (nic_);
|
||||||
|
LIBZMQ_UNUSED (ipv6_);
|
||||||
|
|
||||||
|
errno = ENODEV;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
zmq_assert (ifa != NULL);
|
zmq_assert (ifa != NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user