Skip to content

Commit a3e5da0

Browse files
niklasfbnoordhuis
authored andcommitted
Removed/Fixed TODO DRY
1 parent 38f3bf6 commit a3e5da0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/node_stdio.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ static Handle<Value> OpenStdin(const Arguments& args) {
198198
if (isatty(STDIN_FILENO)) {
199199
// XXX selecting on tty fds wont work in windows.
200200
// Must ALWAYS make a coupling on shitty platforms.
201+
int r = -1;
202+
201203
stdin_flags = fcntl(STDIN_FILENO, F_GETFL, 0);
202-
if (stdin_flags == -1) {
203-
// TODO DRY
204-
return ThrowException(Exception::Error(String::New("fcntl error!")));
204+
205+
if (stdin_flags != -1) {
206+
r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK);
205207
}
206208

207-
int r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK);
208209
if (r == -1) {
209-
// TODO DRY
210210
return ThrowException(Exception::Error(String::New("fcntl error!")));
211211
}
212212
}

0 commit comments

Comments
 (0)