mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-19 16:00:56 +00:00
Force stdout and standerr on Windows to unbuffered mode.
Normally stdout and stderr are buffered. In case of a crash the last lines aren't written to the stdout.txt, making post mortem debugging difficult. Forcing both FDs to unbuffered mode ensures that everything gets written. The performance impact is negliable.
This commit is contained in:
parent
741ffcdb1c
commit
dfaf33e478
1 changed files with 3 additions and 0 deletions
3
src/backends/windows/system.c
Normal file → Executable file
3
src/backends/windows/system.c
Normal file → Executable file
|
@ -717,6 +717,9 @@ Sys_RedirectStdout(void)
|
|||
|
||||
_wfreopen(wpath_stdout, L"w", stdout);
|
||||
_wfreopen(wpath_stderr, L"w", stderr);
|
||||
|
||||
setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
|
||||
setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ);
|
||||
}
|
||||
|
||||
/* ======================================================================= */
|
||||
|
|
Loading…
Reference in a new issue