summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-26 17:33:41 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-26 17:33:41 (GMT)
commit1ebb421bfc8eb21a4e5e56e501a62d000a9f59db (patch)
treeaf67fb0fc045f87b37b891b495ff48e58262283b /Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
parentbc407ba6ba28293b5fc0025fa08e8fe71365eab8 (diff)
parent362435f02a52008a90a1c19862f09b01f1b5bd7f (diff)
downloadCMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.zip
CMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.tar.gz
CMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2017-05-25 (dc596109)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/bsd-ifaddrs.c')
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-ifaddrs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
index 0b5653d..4147894 100644
--- a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
+++ b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
@@ -27,7 +27,9 @@
#include <ifaddrs.h>
#include <net/if.h>
+#if !defined(__CYGWIN__) && !defined(__MSYS__)
#include <net/if_dl.h>
+#endif
static int uv__ifaddr_exclude(struct ifaddrs *ent) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
@@ -107,9 +109,13 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
for (i = 0; i < *count; i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
+#if defined(__CYGWIN__) || defined(__MSYS__)
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
+#else
struct sockaddr_dl* sa_addr;
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+#endif
}
address++;
}