diff options
author | Igor Zinkovsky <igorzi@microsoft.com> | 2011-08-02 05:21:38 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-02 05:30:13 +0400 |
commit | 1c09cc1550af44eaf9d8ba6365d5d7911c41fce3 (patch) | |
tree | 4ea186fe0f2eb1e420994004bf417d7af9de7e0f /src | |
parent | 70bf121f21c03d398a0d3c60e2088c29ff5a0b1b (diff) |
windows: set stdio streams to binary mode
Diffstat (limited to 'src')
-rw-r--r-- | src/node_stdio_win32.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_stdio_win32.cc b/src/node_stdio_win32.cc index f76c71bf62e..489508cab01 100644 --- a/src/node_stdio_win32.cc +++ b/src/node_stdio_win32.cc @@ -25,6 +25,7 @@ #include <v8.h> #include <errno.h> +#include <fcntl.h> #include <io.h> #include <platform_win32.h> @@ -663,6 +664,11 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) { uv_async_init(&tty_avail_notifier, tty_poll); uv_unref(); + /* Set stdio streams to binary mode. */ + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + _setmode(_fileno(stderr), _O_BINARY); + name_symbol = NODE_PSYMBOL("name"); shift_symbol = NODE_PSYMBOL("shift"); ctrl_symbol = NODE_PSYMBOL("ctrl"); |