aboutsummaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 0a9e9f6e3..a6e77170a 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -96,21 +96,27 @@ int curl_getaddrinfo(char *hostname, char *service,
int line, const char *source)
{
int res=(getaddrinfo)(hostname, service, hints, result);
- if(0 == res)
+ if(0 == res) {
/* success */
- fprintf(logfile?logfile:stderr, "ADDR %s:%d getaddrinfo() = %p\n",
- source, line, *result);
- else
- fprintf(logfile?logfile:stderr, "ADDR %s:%d getaddrinfo() failed\n",
- source, line);
+ if(logfile)
+ fprintf(logfile, "ADDR %s:%d getaddrinfo() = %p\n",
+ source, line, *result);
+ }
+ else {
+ if(logfile)
+ fprintf(logfile, "ADDR %s:%d getaddrinfo() failed\n",
+ source, line);
+ }
return res;
}
+
void curl_freeaddrinfo(struct addrinfo *freethis,
int line, const char *source)
{
(freeaddrinfo)(freethis);
- fprintf(logfile?logfile:stderr, "ADDR %s:%d freeaddrinfo(%p)\n",
- source, line, freethis);
+ if(logfile)
+ fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n",
+ source, line, freethis);
}
#endif