diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc index 8ba4a30b042f..54cd64d37d5e 100644 --- a/runtime/bin/file_win.cc +++ b/runtime/bin/file_win.cc @@ -196,6 +196,7 @@ File* File::OpenStdio(int fd) { default: UNREACHABLE(); } + _setmode(fd, _O_BINARY); return new File(new FileHandle(fd)); } diff --git a/tests/standalone/io/stdio_nonblocking_test.dart b/tests/standalone/io/stdio_nonblocking_test.dart index 0740dbe72672..05f5fde4a2a1 100644 --- a/tests/standalone/io/stdio_nonblocking_test.dart +++ b/tests/standalone/io/stdio_nonblocking_test.dart @@ -17,12 +17,7 @@ void main() { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); - if (Platform.isWindows) { - Expect.equals('stdout\r\n\r\ntuodts\r\nABCDEFGHIJKLM\r\n', result.stdout); - Expect.equals('stderr\r\n\r\nrredts\r\nABCDEFGHIJKLM\r\n', result.stderr); - } else { - Expect.equals('stdout\n\ntuodts\nABCDEFGHIJKLM\n', result.stdout); - Expect.equals('stderr\n\nrredts\nABCDEFGHIJKLM\n', result.stderr); - } + Expect.equals('stdout\n\ntuodts\nABCDEFGHIJKLM\n', result.stdout); + Expect.equals('stderr\n\nrredts\nABCDEFGHIJKLM\n', result.stderr); }); }