]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Track state to determine if the associated TTY device node has been used.
authorEd Schouten <ed@FreeBSD.org>
Tue, 23 Sep 2008 17:12:25 +0000 (17:12 +0000)
committerEd Schouten <ed@FreeBSD.org>
Tue, 23 Sep 2008 17:12:25 +0000 (17:12 +0000)
commitb61637107c103f0c45c6b28d47dd48d3864d5c58
tree7df69923e5d79867c0f1c00c015f8348964ddbf3
parentaaa6d7ebb9f9c9a67dbbc11277907cc854879dce
Track state to determine if the associated TTY device node has been used.

It turns out our old TTY layer (and other implementations) block when
you read() on a PTY master device of which the slave device node has not
been opened yet. Our new implementation just returned 0. This caused
applications like telnetd to die in a very subtle way (when child
processes would open the TTY later than the first call to select()).

Introduce a new flag called PTS_FINISHED, which indicates whether we
should block or bail out of a read() or write() occurs.

Reported by: Claude Buisson <clbuisson orange fr>
sys/kern/tty_pts.c