aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_addrinfo.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-18 20:22:04 +0000
committerYang Tse <yangsita@gmail.com>2010-01-18 20:22:04 +0000
commitccfe279117f197d2b3d0bb17bc754209024836a2 (patch)
treeccfd266b8c3b77c37da1515f49dd22b21a8a43bc /lib/curl_addrinfo.c
parent5b5ff41ef1ddd70864c55bdf47edd3f9c942cdc8 (diff)
Constantine Sapuntzakis enhancements to make memory tracking log file writing
of messages atomic, on systems where an fwrite of a memory buffer is atomic.
Diffstat (limited to 'lib/curl_addrinfo.c')
-rw-r--r--lib/curl_addrinfo.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index a5d26165c..07dc1e7f0 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -447,9 +447,8 @@ curl_dofreeaddrinfo(struct addrinfo *freethis,
int line, const char *source)
{
(freeaddrinfo)(freethis);
- if(logfile)
- fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n",
- source, line, (void *)freethis);
+ curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n",
+ source, line, (void *)freethis);
}
#endif /* defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) */
@@ -471,17 +470,13 @@ curl_dogetaddrinfo(const char *hostname,
int line, const char *source)
{
int res=(getaddrinfo)(hostname, service, hints, result);
- if(0 == res) {
+ if(0 == res)
/* success */
- if(logfile)
- fprintf(logfile, "ADDR %s:%d getaddrinfo() = %p\n",
- source, line, (void *)*result);
- }
- else {
- if(logfile)
- fprintf(logfile, "ADDR %s:%d getaddrinfo() failed\n",
- source, line);
- }
+ curl_memlog("ADDR %s:%d getaddrinfo() = %p\n",
+ source, line, (void *)*result);
+ else
+ curl_memlog("ADDR %s:%d getaddrinfo() failed\n",
+ source, line);
return res;
}
#endif /* defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) */