diff options
author | Yang Tse <yangsita@gmail.com> | 2010-01-18 20:22:04 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-01-18 20:22:04 +0000 |
commit | ccfe279117f197d2b3d0bb17bc754209024836a2 (patch) | |
tree | ccfd266b8c3b77c37da1515f49dd22b21a8a43bc /lib/curl_addrinfo.c | |
parent | 5b5ff41ef1ddd70864c55bdf47edd3f9c942cdc8 (diff) | |
download | curl-ccfe279117f197d2b3d0bb17bc754209024836a2.tar.gz |
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.c | 23 |
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) */ |