Re: [PATCH] kdesu broken
From: Linus Torvalds
Date: Tue Jul 28 2009 - 12:49:44 EST
On Tue, 28 Jul 2009, Alan Cox wrote:
>
> We don't ignore it.
Yes we do. Look at Ogawa-san's patch. And read my email answer to it.
> What goes in one end comes out the other after tty
> processing (ldisc, echo etc). Reliably. Both the EOF fix and the
> tty->low_latency fix cure that. [The low latency one also provides the
> *exact* same semantics as we had prior to 2.6.31-rc as well]
I agree that the low-latency thing should fix things, and I applied it.
But I think that Ogawa's patch is fundamentally "correct" at a much higher
level. Rather than depend on low-latency being set, it just "Does The
Right Thing(tm)", by making sure that readers never even look at the EOF
bits etc until they have flushed the tty ldisc state.
> If I understand Ogawa correctly then what emacs thinks is true is quite
> different: Emacs thinks that
>
> write(pty, "data", length)
> close(pty)
> exit()
>
> will always ensure that the other end has already got the data before
> close() completes - or to be more exact before the parent receives SIGCLD.
.. and depending on what emacs does with signals and it's select() loop,
that may actually be _entirely_reasonable_.
Imagine being in 'select()' (or read, for that matter), and getting EINTR
due to SIGCHLD. What is the correct expectations?
The correct expectation is that the select() (or read()) should have
returned any data that it saw _before_ it returns EINTR.
Linus
--
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/