Commit 8825f4df authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ucrtbase: Let stderr be always be unbuffered.

parent d9b3ad05
...@@ -830,9 +830,15 @@ int CDECL _isatty(int fd) ...@@ -830,9 +830,15 @@ int CDECL _isatty(int fd)
/* INTERNAL: Allocate stdio file buffer */ /* INTERNAL: Allocate stdio file buffer */
static BOOL msvcrt_alloc_buffer(FILE* file) static BOOL msvcrt_alloc_buffer(FILE* file)
{ {
#if _MSVCR_VER >= 140
if((file->_file==STDOUT_FILENO && _isatty(file->_file))
|| file->_file == STDERR_FILENO)
return FALSE;
#else
if((file->_file==STDOUT_FILENO || file->_file==STDERR_FILENO) if((file->_file==STDOUT_FILENO || file->_file==STDERR_FILENO)
&& _isatty(file->_file)) && _isatty(file->_file))
return FALSE; return FALSE;
#endif
file->_base = calloc(1, MSVCRT_INTERNAL_BUFSIZ); file->_base = calloc(1, MSVCRT_INTERNAL_BUFSIZ);
if(file->_base) { if(file->_base) {
......
...@@ -55,7 +55,6 @@ static void test_std_stream_buffering(void) ...@@ -55,7 +55,6 @@ static void test_std_stream_buffering(void)
if (broken(!GetProcAddress(GetModuleHandleA("ucrtbase"), "__CxxFrameHandler4") && !pos)) if (broken(!GetProcAddress(GetModuleHandleA("ucrtbase"), "__CxxFrameHandler4") && !pos))
trace("stderr is buffered\n"); trace("stderr is buffered\n");
else else
todo_wine
ok(pos == 4, "expected stderr to be unbuffered (%d)\n", pos); ok(pos == 4, "expected stderr to be unbuffered (%d)\n", pos);
fflush(stderr); fflush(stderr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment