From: Florian Forster Date: Wed, 30 Jan 2008 07:11:12 +0000 (+0100) Subject: src/liboping.c: Use \#ifdef's around `EAI_SYSTEM'. X-Git-Tag: Net-Oping-1.02~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c83ef784bdc0d14fd2b1c20853b678ccc4e18ee;p=liboping.git 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.. --- 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; }