When running tests under network sandbox, there is no connectivity to
the DNS, in this case function returns system error and ECONNREFUSED
this should result in skipping test.

Signed-off-by: Alon Bar-Lev <alon.bar...@gmail.com>
---
 tests/test-getaddrinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index acf9cd6..b155410 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -85,7 +85,7 @@ simple (char const *host, char const *service)
       /* EAI_AGAIN is returned if no network is available. Don't fail
          the test merely because someone is down the country on their
          in-law's farm. */
-      if (res == EAI_AGAIN)
+      if (res == EAI_AGAIN || (res == EAI_SYSTEM && err == ECONNREFUSED))
         {
           skip++;
           fprintf (stderr, "skipping getaddrinfo test: no network?\n");
-- 
1.8.3.2


Reply via email to