mirror of
https://github.com/curl/curl.git
synced 2026-05-16 17:56:21 +03:00
Added call to setvbuf (disabled by default for speed) to flush the
memdebug log file after every line and avoid losing the last few log entries if curl crashes.
This commit is contained in:
parent
ea43bb013b
commit
3fef839f75
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue