Chromium Code Reviews| Index: runtime/bin/eventhandler_win.cc |
| diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc |
| index 7c96ce88339311cd7978b0a451e2202a339880b3..fdc35824dda5c1dd930cc1054ac44f476fba0d91 100644 |
| --- a/runtime/bin/eventhandler_win.cc |
| +++ b/runtime/bin/eventhandler_win.cc |
| @@ -11,6 +11,8 @@ |
| #include <winsock2.h> // NOLINT |
| #include <ws2tcpip.h> // NOLINT |
| #include <mswsock.h> // NOLINT |
| +#include <io.h> // NOLINT |
| +#include <fcntl.h> // NOLINT |
| #include "bin/builtin.h" |
| #include "bin/dartutils.h" |
| @@ -326,6 +328,18 @@ bool FileHandle::IsClosed() { |
| } |
| +void FileHandle::DoClose() { |
| + if (GetStdHandle(STD_OUTPUT_HANDLE) == handle_) { |
| + int fd = _open("NUL", _O_WRONLY); |
|
kustermann
2013/06/28 10:10:14
Is this opening a file called "NUL" or an actual /
Anders Johnsen
2013/06/28 10:19:11
Yep, check out http://en.wikipedia.org/wiki/%5CDev
|
| + ASSERT(fd >= 0); |
| + USE(_dup2(fd, _fileno(stdout))); |
| + USE(close(fd)); |
|
kustermann
2013/06/28 10:10:14
AFAIK USE() is not necessary here.
USE() is useful
Anders Johnsen
2013/06/28 10:19:11
I think you are right. Will try without.
|
| + } else { |
| + Handle::DoClose(); |
| + } |
| +} |
| + |
| + |
| void SocketHandle::HandleIssueError() { |
| int error = WSAGetLastError(); |
| if (error == WSAECONNRESET) { |