Fix opposite logic, which coincidentially works
authorRyan Dahl <ry@tinyclouds.org>
Fri, 21 May 2010 05:11:26 +0000 (22:11 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Fri, 21 May 2010 05:11:26 +0000 (22:11 -0700)
src/node.js
src/node_stdio.cc

index 66523f5..a17ba6f 100644 (file)
@@ -175,10 +175,10 @@ process.openStdin = function () {
       fd = binding.openStdin();
 
   if (binding.isStdinBlocking()) {
+    stdin = new fs.ReadStream(null, {fd: fd});
+  } else {
     stdin = new net.Stream(fd);
     stdin.readable = true;
-  } else {
-    stdin = new fs.ReadStream(null, {fd: fd});
   }
 
   stdin.resume();
index 183a6ea..a68d302 100644 (file)
@@ -69,7 +69,7 @@ static Handle<Value>
 IsStdinBlocking (const Arguments& args)
 {
   HandleScope scope;
-  return scope.Close(Boolean::New(isatty(STDIN_FILENO)));
+  return scope.Close(Boolean::New(!isatty(STDIN_FILENO)));
 }
 
 static Handle<Value>