We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38f3bf6 commit a3e5da0Copy full SHA for a3e5da0
1 file changed
src/node_stdio.cc
@@ -198,15 +198,15 @@ static Handle<Value> OpenStdin(const Arguments& args) {
198
if (isatty(STDIN_FILENO)) {
199
// XXX selecting on tty fds wont work in windows.
200
// Must ALWAYS make a coupling on shitty platforms.
201
+ int r = -1;
202
+
203
stdin_flags = fcntl(STDIN_FILENO, F_GETFL, 0);
- if (stdin_flags == -1) {
- // TODO DRY
204
- return ThrowException(Exception::Error(String::New("fcntl error!")));
205
+ if (stdin_flags != -1) {
206
+ r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK);
207
}
208
- int r = fcntl(STDIN_FILENO, F_SETFL, stdin_flags | O_NONBLOCK);
209
if (r == -1) {
210
return ThrowException(Exception::Error(String::New("fcntl error!")));
211
212
0 commit comments