Skip to content

Commit

Permalink
ucrtbase: Let stderr be always be unbuffered.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
  • Loading branch information
Eric Pouech authored and julliard committed Apr 11, 2024
1 parent d9b3ad0 commit 8825f4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dlls/msvcrt/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,15 @@ int CDECL _isatty(int fd)
/* INTERNAL: Allocate stdio file buffer */
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)
&& _isatty(file->_file))
return FALSE;
#endif

file->_base = calloc(1, MSVCRT_INTERNAL_BUFSIZ);
if(file->_base) {
Expand Down
1 change: 0 additions & 1 deletion dlls/ucrtbase/tests/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static void test_std_stream_buffering(void)
if (broken(!GetProcAddress(GetModuleHandleA("ucrtbase"), "__CxxFrameHandler4") && !pos))
trace("stderr is buffered\n");
else
todo_wine
ok(pos == 4, "expected stderr to be unbuffered (%d)\n", pos);

fflush(stderr);
Expand Down

0 comments on commit 8825f4d

Please sign in to comment.