Эх сурвалжийг харах

fix broke build, add missing variable declaration

Jan Klemkow 5 жил өмнө
parent
commit
8718290ad5
2 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 5 2
      ptty.c
  2. 1 0
      scroll.c

+ 5 - 2
ptty.c

@@ -87,8 +87,11 @@ main(int argc, char *argv[])
 	if (fh == NULL)
 	if (fh == NULL)
 		die("fdopen");
 		die("fdopen");
 
 
-	char buf[BUFSIZ];
-	while (fgets(buf, sizeof buf, fh) != NULL);
+	if (close(mfd) == -1)
+		die("close:");
+
+//	char buf[BUFSIZ];
+//	while (fgets(buf, sizeof buf, fh) != NULL);
 
 
 	int status;
 	int status;
 	waitpid(pid, &status, 0);
 	waitpid(pid, &status, 0);

+ 1 - 0
scroll.c

@@ -543,6 +543,7 @@ main(int argc, char *argv[])
 	if (close(mfd) == -1)
 	if (close(mfd) == -1)
 		die("close:");
 		die("close:");
 
 
+	pid_t pid;
 	int status;
 	int status;
 	while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
 	while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
 		if (pid != child)
 		if (pid != child)