SetBlocking should set blocking, not toggle it
authorisaacs <i@izs.me>
Wed, 4 Aug 2010 01:39:43 +0000 (18:39 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 4 Aug 2010 16:58:56 +0000 (09:58 -0700)
src/node_child_process.cc

index c971ad7..2b8803a 100644 (file)
@@ -36,7 +36,7 @@ static inline int SetNonBlocking(int fd) {
 
 static inline int SetBlocking(int fd) {
   int flags = fcntl(fd, F_GETFL, 0);
-  int r = fcntl(fd, F_SETFL, flags O_NONBLOCK);
+  int r = fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
   if (r != 0) perror("SetBlocking()");
   return r;
 }