From owner-freebsd-bugs Fri Dec 25 02:10:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA24098 for freebsd-bugs-outgoing; Fri, 25 Dec 1998 02:10:14 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA24093 for ; Fri, 25 Dec 1998 02:10:11 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id CAA01171; Fri, 25 Dec 1998 02:10:01 -0800 (PST) Date: Fri, 25 Dec 1998 02:10:01 -0800 (PST) Message-Id: <199812251010.CAA01171@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Bruce Evans Subject: Re: bin/9188: telnet gets stuck in ttydrain() Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/9188; it has been noted by GNATS. From: Bruce Evans To: FreeBSD-gnats-submit@FreeBSD.ORG, toasty@dragondata.com Cc: Subject: Re: bin/9188: telnet gets stuck in ttydrain() Date: Fri, 25 Dec 1998 21:04:54 +1100 > 11573 telnet CALL write(0x1,0x8058c20,0x174) > 11573 telnet RET write -1 errno 5 Input/output error > 11573 telnet CALL ioctl(0,TIOCSETAW,0xefbfd8c8) > 11573 telnet RET ioctl -1 errno 9 Bad file descriptor > 11573 telnet CALL write(0x1,0x8058c20,0x174) > 11573 telnet RET write -1 errno 5 Input/output error > 11573 telnet CALL ioctl(0,TIOCSETAW,0xefbfd8c8) > 11573 telnet RET ioctl -1 errno 9 Bad file descriptor > 11573 telnet CALL write(0x1,0x8058c20,0x174) > 11573 telnet RET write -1 errno 5 Input/output error > 11573 telnet CALL ioctl(0,TIOCSETAW,0xefbfd8c8) > 11573 telnet RET ioctl -1 errno 9 Bad file descriptor > >Which appears to be in sys_bsd.c:ttydrain > >Perhaps that while loop should check for fatal errors rather than retrying >everything? Or is this a case that it should never have gotten this far with >the FD being closed? The tty appears to be revoked, not closed. write() would set errno to EBADF if the FD were closed. ioctl() shouldn't return EBADF for open revoked FDs, but it was broken until a month or two after 3.0R. Now it returns ENOTTY. This won't help telnet. The loop seems to be actually in sys_bsd.c:TerminalNewMode. ttydrain doesn't exist. Telnet shouldn't retry after an error unless it knows that this is OK (perhaps it is OK for EAGAIN). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message