diff options
author | ed <ed@FreeBSD.org> | 2008-08-22 10:40:21 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-08-22 10:40:21 +0000 |
commit | 7c4fe3955e6f6e21209b7d30754f9f07ac12f1af (patch) | |
tree | 6584ebe1656b550cf8be810b9f152727959b6fe4 /contrib/ntp/ntpd/refclock_datum.c | |
parent | 958ba94773af71ad6ee87a0be93b8b60ad679b3f (diff) | |
download | FreeBSD-src-7c4fe3955e6f6e21209b7d30754f9f07ac12f1af.zip FreeBSD-src-7c4fe3955e6f6e21209b7d30754f9f07ac12f1af.tar.gz |
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
Diffstat (limited to 'contrib/ntp/ntpd/refclock_datum.c')
0 files changed, 0 insertions, 0 deletions