Browse Source

explicit continue on EOF while read vom child, plus comment

Jan Klemkow 6 năm trước cách đây
mục cha
commit
c4153df620
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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:");