Date: Thu, 14 Dec 1995 01:10:41 +1100 From: Bruce Evans <bde@zeta.org.au> To: eugen@rd.zgik.zaporizhzhe.ua, hackers@FreeBSD.ORG Cc: yura@rd.zgik.zaporizhzhe.ua Subject: Re: bug or feature in kern/tty.c Message-ID: <199512131410.BAA23057@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>I found strange thing in 2.1.0-RELEASE (and -current) in kern/tty.c. >When carrier was lossed then ttymodem() set TS_ZOMBIE and clear >TS_CONNECTED in tp->t_state. But TS_ZOMBIE is cleared only in ttioctl() >TIOCSETA* when line is setted to ignore modem status and when line is closed. POSIX says that (what I call the) zombie state remains until the line is closed. Clearing it when CLOCAL is raised is a special hack that helped very old (1.1.5) versions of slattach and perhaps other broken programs work right. >As result in ttymodem() after lossing carrier TS_CONNECTED is not setting >whithout reopening line or changing c_cflag to CLOCAL, and if this line >used for SLIP connection as result we have 'No route to host' error >when trying output to this line after modem reconnected. >Or is this bug in slattach ? slattach never set CLOCAL when it's working >with modem control and without redial cmd. Yes. slattach goes to a lot of trouble to close the line, but only for the redial_command case. The !redial_command case in sighup_handler() can't work for real SIGHUPs. In 1.1.5, the only way to close the line was to exit from the process. slattach goes to a lot of trouble to make itself the controlling process so that SIGHUPs get sent to it. The line can't be fully closed until it stops being a controlling terminal, and in 1.1.5 there was no way to stop it being a controlling terminal except to exit! :-( 2.x is better (TIOCSCTTY releases the previous control terminal, if any). Anyway, slattach still exits (in daemon() in aquire_line()) for the redial_command case. According to the man page, slattach aborts if it receives a SIGHUP in the !redial_command case. This got broken when complications to get rid of the controlling terminal were introduced. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512131410.BAA23057>