浏览代码

ptty: write input from child to stdout

Jan Klemkow 5 年之前
父节点
当前提交
db05bd2318
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ptty.c

+ 2 - 1
ptty.c

@@ -96,7 +96,8 @@ main(int argc, char *argv[])
 		die("close:");
 
 	char buf[BUFSIZ];
-	while (fgets(buf, sizeof buf, fh) != NULL);
+	while (fgets(buf, sizeof buf, fh) != NULL)
+		fputs(buf, stdout);
 
 	int status;
 	waitpid(pid, &status, 0);