From 4c83ef784bdc0d14fd2b1c20853b678ccc4e18ee Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 30 Jan 2008 08:11:12 +0100 Subject: [PATCH] src/liboping.c: Use \#ifdef's around `EAI_SYSTEM'. Apparently this define is mentioned in RFC3493 but not in SUS. At least Cygwin seems not to have this define.. --- src/liboping.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/liboping.c b/src/liboping.c index 0371f15..22ab3a8 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -941,9 +941,11 @@ int ping_setopt (pingobj_t *obj, int option, void *value) if (status != 0) { ping_set_error (obj, "getaddrinfo", - status == EAI_SYSTEM - ? strerror (errno) - : gai_strerror (status)); +#if defined(EAI_SYSTEM) + (status == EAI_SYSTEM) + ? strerror (errno) : +#endif + gai_strerror (status)); ret = -1; break; } @@ -1073,9 +1075,11 @@ int ping_host_add (pingobj_t *obj, const char *host) { dprintf ("getaddrinfo failed\n"); ping_set_error (obj, "getaddrinfo", - (ai_return == EAI_SYSTEM) - ? strerror (errno) - : gai_strerror (ai_return)); +#if defined(EAI_SYSTEM) + (ai_return == EAI_SYSTEM) + ? strerror (errno) : +#endif + gai_strerror (ai_return)); ping_free (ph); return (-1); } @@ -1306,8 +1310,10 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info, #endif ) ret = ENOMEM; +#if defined(EAI_SYSTEM) else if (ret == EAI_SYSTEM) ret = errno; +#endif else ret = EINVAL; } -- 2.11.0