Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1592)

Unified Diff: runtime/bin/socket_win.cc

Issue 154273003: Make std* blocking file-descriptors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update with bug. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | runtime/bin/stdio_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_win.cc
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 36648306a17f57b381697fd23fd1f69fdb5568f4..2675dce4ab8a51534f1c30d9ad77c38cac620fb9 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -195,24 +195,12 @@ int Socket::GetType(intptr_t fd) {
intptr_t Socket::GetStdioHandle(intptr_t num) {
- HANDLE handle;
- switch (num) {
- case 0:
- handle = GetStdHandle(STD_INPUT_HANDLE);
- break;
- case 1:
- handle = GetStdHandle(STD_OUTPUT_HANDLE);
- break;
- case 2:
- handle = GetStdHandle(STD_ERROR_HANDLE);
- break;
- default: UNREACHABLE();
- }
+ if (num != 0) return -1;
+ HANDLE handle = GetStdHandle(STD_INPUT_HANDLE);
if (handle == INVALID_HANDLE_VALUE) {
return -1;
}
StdHandle* std_handle = new StdHandle(handle);
- if (std_handle == NULL) return -1;
std_handle->MarkDoesNotSupportOverlappedIO();
std_handle->EnsureInitialized(EventHandler::delegate());
return reinterpret_cast<intptr_t>(std_handle);
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | runtime/bin/stdio_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698