浏览代码

explicit continue on EOF while read vom child, plus comment

Jan Klemkow 5 年之前
父节点
当前提交
c4153df620
共有 1 个文件被更改,包括 2 次插入0 次删除
  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:");