From bdf6427a0017ccbd87d8b0a0a7e211bf9d6c14a4 Mon Sep 17 00:00:00 2001 From: chrox Date: Sun, 22 Jun 2014 18:05:50 +0800 Subject: [PATCH] Fixed build with arm-linux-androideabi toolchain --- src/tcp_address.cpp | 4 ++-- tests/test_filter_ipc.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tcp_address.cpp b/src/tcp_address.cpp index 507fbc66..8a6eedbc 100644 --- a/src/tcp_address.cpp +++ b/src/tcp_address.cpp @@ -136,10 +136,10 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_ } if (is_src_) memcpy (&source_address.ipv4.sin_addr, - &((sockaddr_in*) &ifr.ifr_addr)->sin_addr, sizeof in_addr); + &((sockaddr_in*) &ifr.ifr_addr)->sin_addr, sizeof (struct in_addr)); else memcpy (&address.ipv4.sin_addr, - &((sockaddr_in*) &ifr.ifr_addr)->sin_addr, sizeof in_addr); + &((sockaddr_in*) &ifr.ifr_addr)->sin_addr, sizeof (struct in_addr)); return 0; } diff --git a/tests/test_filter_ipc.cpp b/tests/test_filter_ipc.cpp index 6a3b8a76..00518f71 100644 --- a/tests/test_filter_ipc.cpp +++ b/tests/test_filter_ipc.cpp @@ -122,7 +122,7 @@ int main (void) // Get the group and supplimental groups of the process owner gid_t groups[100]; int ngroups = getgroups(100, groups); - assert (ngroups != -1); + assert (ngroups != -1 && ngroups != 0); gid_t group = getgid(), supgroup = groups[0], notgroup = groups[ngroups - 1] + 1; for (int i = 0; i < ngroups; i++) { if (supgroup == group && group != groups[i])