]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Added call to setvbuf (disabled by default for speed) to flush the
authorDan Fandrich <dan@coneharvesters.com>
Tue, 15 May 2007 00:36:56 +0000 (00:36 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 15 May 2007 00:36:56 +0000 (00:36 +0000)
memdebug log file after every line and avoid losing the last few log
entries if curl crashes.

lib/memdebug.c

index 110169474bc652e2b2e7b081bc8af93a051133e5..582387cf9ceb533df658ea090025164f1bae0573 100644 (file)
@@ -73,6 +73,10 @@ void curl_memdebug(const char *logname)
       logfile = fopen(logname, "w");
     else
       logfile = stderr;
+#ifdef MEMDEBUG_LOG_SYNC
+    /* Flush the log file after every line so the log isn't lost in a crash */
+    setvbuf(logfile, (char *)NULL, _IOLBF, 0);
+#endif
   }
 }