Constantine Sapuntzakis enhancements to make memory tracking log file writing

of messages atomic, on systems where an fwrite of a memory buffer is atomic.
This commit is contained in:
Yang Tse 2010-01-18 20:22:04 +00:00
parent 5b5ff41ef1
commit ccfe279117
5 changed files with 96 additions and 69 deletions

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2008, 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
@ -35,6 +35,10 @@
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#if defined(CURLDEBUG) && defined(CURLTOOLDEBUG)
#include "memdebug.h"
#endif
static const struct
{
const char * name;
@ -69,9 +73,7 @@ static void internalSetEnv(const char * name, char * value)
#ifdef __riscos__
_kernel_setenv(name, value);
#elif defined (CURLDEBUG)
extern FILE *curl_debuglogfile;
if (curl_debuglogfile)
fprintf (curl_debuglogfile, "ENV %s = %s\n", name, value);
curl_memlog("ENV %s = %s\n", name, value);
#endif
return;
}