Explorar el Código

fix return code handling of forkpty

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

+ 2 - 2
scroll.c

@@ -135,9 +135,9 @@ main(int argc, char *argv[])
 		die("ioctl:");
 
 	child = forkpty(&mfd, NULL, &dfl, &ws);
-	if (child < 0)
+	if (child == -1)
 		die("forkpty:");
-	if (!child) {
+	if (child == 0) {	/* child */
 		execvp(argv[1], argv + 1);
 		perror("execvp");
 		_exit(127);