diff options
author | Yang Tse <yangsita@gmail.com> | 2008-09-26 11:21:22 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-09-26 11:21:22 +0000 |
commit | 57ee847ce7e07b2744f46be990f887d067c00d44 (patch) | |
tree | 679b754954f79afeaf82b28ee368d6620b4ba7b9 /tests/server/resolve.c | |
parent | 985bd18904a2184bc5c43f75a1dcbbcc1dc7256f (diff) | |
download | gnurl-57ee847ce7e07b2744f46be990f887d067c00d44.tar.gz gnurl-57ee847ce7e07b2744f46be990f887d067c00d44.tar.bz2 gnurl-57ee847ce7e07b2744f46be990f887d067c00d44.zip |
Avoid the use of the '? :' operator inside the call to our
test-server logging function. It doesn't work on some systems.
Diffstat (limited to 'tests/server/resolve.c')
-rw-r--r-- | tests/server/resolve.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/server/resolve.c b/tests/server/resolve.c index 57edde99b..27723942c 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -61,7 +61,10 @@ /* include memdebug.h last */ #include "memdebug.h" -static char use_ipv6=FALSE; +#ifdef ENABLE_IPV6 +static bool use_ipv6 = FALSE; +#endif +static const char *ipv_inuse = "IPv4"; const char *serverlogfile=""; /* for a util.c function we don't use */ @@ -84,13 +87,17 @@ int main(int argc, char *argv[]) } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 - use_ipv6=TRUE; + ipv_inuse = "IPv6"; + use_ipv6 = TRUE; #endif arg++; } else if(!strcmp("--ipv4", argv[arg])) { /* for completeness, we support this option as well */ - use_ipv6=FALSE; +#ifdef ENABLE_IPV6 + ipv_inuse = "IPv4"; + use_ipv6 = FALSE; +#endif arg++; } else { @@ -136,7 +143,7 @@ int main(int argc, char *argv[]) } #endif if(rc) - printf("Resolving IPv%d '%s' didn't work\n", (use_ipv6?6:4), host); + printf("Resolving %s '%s' didn't work\n", ipv_inuse, host); return !rc?0:1; } |