Merge branch 'michal/prevent-unbuffered-stderr-io-on-windows-v9_11' into 'v9_11'

[v9_11] Prevent unbuffered stderr I/O on Windows

See merge request isc-projects/bind9!2402
This commit is contained in:
Michał Kępień
2019-09-26 08:00:55 -04:00
+11
View File
@@ -1414,6 +1414,17 @@ main(int argc, char *argv[]) {
(void) ProfilerStart(NULL);
#endif
#ifdef WIN32
/*
* Prevent unbuffered I/O from crippling named performance on Windows
* when it is logging to stderr (e.g. in system tests). Use full
* buffering (_IOFBF) as line buffering (_IOLBF) is unavailable on
* Windows and fflush() is called anyway after each log message gets
* written to the default stderr logging channels created by libisc.
*/
setvbuf(stderr, NULL, _IOFBF, BUFSIZ);
#endif
/*
* Record version in core image.
* strings named.core | grep "named version:"