funny behaviour of shutdown

A.Kuznetsov (inr-linux-kernel@ms2.inr.ac.ru)
Tue, 16 Apr 1996 18:31:07 +0400 (MSD)


Hello!

Very long ago, line marked by exclamations was missing
in tty_io.c.

void disassociate_ctty(int on_exit)
{
struct tty_struct *tty = current->tty;
struct task_struct *p;

if (tty) {
!!!!! if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY)
tty_vhangup(tty);
} else {
....

When it was inserted (I forgot patch level number),
my "shutdown" stopped to make any tty output after kill(-1, SIGKILL)

/* now use brute force... */
fprintf(stderr, "KILL..."); <---- It is the last thing that shutdown
outputs.
kill(-1, SIGKILL);
/* turn off accounting now that all procs are gone... */
acct(NULL);
fprintf(stderr, "SYNC..."); <---- It is lost.
sync();

Apparently, its tty has been hunged up. But why?
Is it shutdown wrong? Or is it bug in kernel?

I've just deleted new line 8) and forgot about it,
but recently new check tty->driver.type != TTY_DRIVER_TYPE_PTY
was added, my patch failed and it reminded me about this problem.

May somebody clarify it?

Alexey Kuznetsov.