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

Unified Diff: runtime/bin/stdin_macos.cc

Issue 24315008: Make stdin blocking when using Stdin::readByte and readLine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/stdin_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdin_macos.cc
diff --git a/runtime/bin/stdin_macos.cc b/runtime/bin/stdin_macos.cc
index cb37a8b78ce12485360e697a5668435fb9591827..0bea869609749e059a7a639eae818fcdab9d67f7 100644
--- a/runtime/bin/stdin_macos.cc
+++ b/runtime/bin/stdin_macos.cc
@@ -8,16 +8,19 @@
#include <termios.h> // NOLINT
#include "bin/stdin.h"
+#include "bin/fdutils.h"
namespace dart {
namespace bin {
int Stdin::ReadByte() {
+ FDUtils::SetBlocking(fileno(stdin));
int c = getchar();
if (c == EOF) {
c = -1;
}
+ FDUtils::SetNonBlocking(fileno(stdin));
return c;
}
« no previous file with comments | « runtime/bin/stdin_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698