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

Unified Diff: runtime/bin/stdio_linux.cc

Issue 165723007: Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tiny fix. Created 6 years, 9 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/stdio_android.cc ('k') | runtime/bin/stdio_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio_linux.cc
diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc
index 43ece5241ef6ebc6743a3211a7acb1133e3e38b3..dee8c389e3669ece4c9c9672209ae31e00aaa60c 100644
--- a/runtime/bin/stdio_linux.cc
+++ b/runtime/bin/stdio_linux.cc
@@ -11,14 +11,15 @@
#include "bin/stdio.h"
#include "bin/fdutils.h"
-#include "bin/signal_blocker.h"
+
+#include "platform/signal_blocker.h"
namespace dart {
namespace bin {
int Stdin::ReadByte() {
- int c = getchar();
+ int c = NO_RETRY_EXPECTED(getchar());
if (c == EOF) {
c = -1;
}
@@ -28,46 +29,45 @@ int Stdin::ReadByte() {
bool Stdin::GetEchoMode() {
struct termios term;
- tcgetattr(STDIN_FILENO, &term);
+ VOID_NO_RETRY_EXPECTED(tcgetattr(STDIN_FILENO, &term));
return (term.c_lflag & ECHO) != 0;
}
void Stdin::SetEchoMode(bool enabled) {
struct termios term;
- tcgetattr(STDIN_FILENO, &term);
+ VOID_NO_RETRY_EXPECTED(tcgetattr(STDIN_FILENO, &term));
if (enabled) {
term.c_lflag |= ECHO|ECHONL;
} else {
term.c_lflag &= ~(ECHO|ECHONL);
}
- tcsetattr(STDIN_FILENO, TCSANOW, &term);
+ VOID_NO_RETRY_EXPECTED(tcsetattr(STDIN_FILENO, TCSANOW, &term));
}
bool Stdin::GetLineMode() {
struct termios term;
- tcgetattr(STDIN_FILENO, &term);
+ VOID_NO_RETRY_EXPECTED(tcgetattr(STDIN_FILENO, &term));
return (term.c_lflag & ICANON) != 0;
}
void Stdin::SetLineMode(bool enabled) {
struct termios term;
- tcgetattr(STDIN_FILENO, &term);
+ VOID_NO_RETRY_EXPECTED(tcgetattr(STDIN_FILENO, &term));
if (enabled) {
term.c_lflag |= ICANON;
} else {
term.c_lflag &= ~(ICANON);
}
- tcsetattr(STDIN_FILENO, TCSANOW, &term);
+ VOID_NO_RETRY_EXPECTED(tcsetattr(STDIN_FILENO, TCSANOW, &term));
}
bool Stdout::GetTerminalSize(int size[2]) {
struct winsize w;
- if (TEMP_FAILURE_RETRY_BLOCK_SIGNALS(
- ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == 0) &&
+ if (NO_RETRY_EXPECTED(ioctl(STDOUT_FILENO, TIOCGWINSZ, &w)) == 0 &&
(w.ws_col != 0 || w.ws_row != 0)) {
size[0] = w.ws_col;
size[1] = w.ws_row;
« no previous file with comments | « runtime/bin/stdio_android.cc ('k') | runtime/bin/stdio_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698