cvs commit: src/sys/kern tty_pts.c
Ed Schouten
ed at FreeBSD.org
Fri Aug 22 10:40:24 UTC 2008
ed 2008-08-22 10:40:21 UTC
FreeBSD src repository
Modified files:
sys/kern tty_pts.c
Log:
SVN rev 182001 on 2008-08-22 10:40:21Z by ed
Fix pts(4) error codes when slave device is closed.
Unlike pre-MPSAFE TTY, the pts(4) driver always returned ENXIO when a
read() or write() was performed on a pseudo-terminal master device when
the slave device was not opened. The old implementation had different
semantics:
- When the slave device had not been opened yet, read() and write() just
blocked.
- When the slave device had been closed, a read() call would return 0
bytes length.
- When the slave device had been closed, a write() call would return
EIO.
Change the new implementation to return 0 and EIO as well. We don't
implement the first rule, but I suspect this is not needed, because
routines like openpty() also open the slave device node. posix_openpt()
users also do similar things.
Reported by: rink
Tested by: rink
Revision Changes Path
1.20 +2 -4 src/sys/kern/tty_pts.c
More information about the cvs-src
mailing list