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 <[email protected]>
(cherry picked from commit 8825f4d)

Link: ValveSoftware/wine#224
  • Loading branch information
Eric Pouech authored and bylaws committed Sep 6, 2024
1 parent 3ece222 commit 90a4cf4
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 @@ -845,9 +845,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 90a4cf4

Please sign in to comment.