From a3e5da07b4c9da50511816d7959e64ae12083004 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Sat, 25 Dec 2010 00:40:48 +0100 Subject: [PATCH] Removed/Fixed TODO DRY --- src/node_stdio.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node_stdio.cc b/src/node_stdio.cc index f744e3f..f654d2b 100644 --- a/src/node_stdio.cc +++ b/src/node_stdio.cc @@ -198,15 +198,15 @@ static Handle OpenStdin(const Arguments& args) { if (isatty(STDIN_FILENO)) { // XXX selecting on tty fds wont work in windows. // Must ALWAYS make a coupling on shitty platforms. + int r = -1; + stdin_flags = fcntl(STDIN_FILENO, F_GETFL, 0); - if (stdin_flags == -1) { - // TODO DRY - return ThrowException(Exception::Error(String::New("fcntl error!"))); + + if (stdin_flags != -1) { + r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK); } - int r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK); if (r == -1) { - // TODO DRY return ThrowException(Exception::Error(String::New("fcntl error!"))); } } -- 2.7.4