- 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
diff -u main.c.org main.c
--- main.c.org 2011-06-08 16:04:27.868884290 +0200 id=waitpid( childpid, &status, WNOHANG ); id=waitpid( childpid, &status, 0 );
+++ main.c 2011-06-09 12:11:30.512715993 +0200
@@ -280,6 +280,7 @@
}
}
wait_
+ sleep(2);
} else {
wait_
}
@@ -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