Comment 9 for bug 774882

Revision history for this message
Rigo Schultz (schultz-h) wrote : Re: doesn't work in natty

diff -u main.c.org main.c

--- main.c.org 2011-06-08 16:04:27.868884290 +0200
+++ main.c 2011-06-09 12:11:30.512715993 +0200
@@ -280,6 +280,7 @@
   }
      }
      wait_id=waitpid( childpid, &status, WNOHANG );
+ sleep(2);
  } else {
      wait_id=waitpid( childpid, &status, 0 );
  }
@@ -311,7 +312,7 @@

     int numread=read(fd, buffer, sizeof(buffer) );

- if( numread<0 ) {
+ if( numread<0 && errno!=5) {
         // Comment no. 3.1416
         // Select is doing a horrid job of waking us up at the right time - it wakes up with "read ready" when the slave
         // end of the pty is closed. This result in an IO error when we perform a read. In the general case, this does