Explorar el Código

explicit continue on EOF while read vom child, plus comment

Jan Klemkow hace 5 años
padre
commit
c4153df620
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      scroll.c

+ 2 - 0
scroll.c

@@ -508,6 +508,8 @@ main(int argc, char *argv[])
 
 			if (n == -1 && errno != EINTR)
 				die("read:");
+			if (n == 0)	/* on exit of child we continue here */
+				continue; /* let signal handler catch SIGCHLD */
 
 			if (write(STDOUT_FILENO, input, n) == -1)
 				die("write:");