infinite loop in ftp

tas at mcnc.UUCP tas at mcnc.UUCP
Sat Feb 28 07:17:31 AEST 1987


Index:	ucb/ftp/main.c 4.3BSD

Description:
	Ftp goes into an infinite loop on a stdin error.

Repeat-By:
	Start an ftp transfer of a large file, put the ftp
	process in the background, log out. Log back in,
	wait until the file transfer is complete, note the ftp
	process hanging around eating up cpu time. Logging out
	causes subsequent stdin reads by ftp to fail, but ftp
	ignores the errors, so when it's done with the file transfer
	and goes back into the command loop, it goes into a tight loop
	trying to read a dead stdin.

Fix:
	212c212
	< 			if (feof(stdin))
	---
	> 			if (feof(stdin) || ferror(stdin))



More information about the Comp.bugs.4bsd.ucb-fixes mailing list