Re: [PATCH] kdesu broken

From: Alan Cox
Date: Mon Jul 27 2009 - 09:58:32 EST


> > + /* Indicate that the other end is now closed, set the
> > + ENDPENDING marker so that the true end can be processed by
>
> This seems typo s/ENDPENDING/EOFPENDING/

I renamed it but missed that.

> > @@ -47,13 +50,22 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
>
> [...]
>
> > + set_bit(TTY_EOFPENDING, &pair->flags);
> > + set_bit(TTY_OTHER_CLOSED, &pair->flags);
> > + spin_unlock_irqrestore(&pair->buf.lock, flags);
>
> tty_flip_buffer_push() or something?
>
> > + wake_up_interruptible(&pair->read_wait);
> > + wake_up_interruptible(&pair->write_wait);
>
> It seems, this sets TTY_EOFPENDING, but if flush_to_ldisc() was done
> already here, anybody doesn't set TTY_EOF for master.

Does putting a tty_flip_buffer_push() at that point fix it. I had thought
I could remove it but you are right that creates a situation where EOF
may never get set.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/