summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_generic.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-01-05 22:20:31 +0000
committerjhb <jhb@FreeBSD.org>2006-01-05 22:20:31 +0000
commit6d056f7e81646d633af5284304365fe626e950d8 (patch)
tree9c0183cf9929ba027e88431a781e0ec7164fd8f9 /sys/kern/sys_generic.c
parent0371a67ccd75282fd058553761d05e3b30cfb029 (diff)
downloadFreeBSD-src-6d056f7e81646d633af5284304365fe626e950d8.zip
FreeBSD-src-6d056f7e81646d633af5284304365fe626e950d8.tar.gz
Remove XXX comments complaining that write(2) on a read-only descriptor
returns EBADF. That errno is correct and is mandated by POSIX. It also goes back to revision 1.1 of our CVS history (i.e. 4.4BSD). The _fget() function should probably also be upated as it currently returns EINVAL in that case rather than EBADF. (It does return EBADF for reads on a write-only descriptor without any XXX comments oddly enough.) Discussed with: scottl, grog, mjacob, bde
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 3c7199a..43d2758 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -398,7 +398,7 @@ kern_writev(struct thread *td, int fd, struct uio *auio)
error = fget_write(td, fd, &fp);
if (error)
- return (EBADF); /* XXX this can't be right */
+ return (EBADF);
error = dofilewrite(td, fd, fp, auio, (off_t)-1, 0);
fdrop(fp, td);
return (error);
@@ -444,7 +444,7 @@ kern_pwritev(td, fd, auio, offset)
error = fget_write(td, fd, &fp);
if (error)
- return (EBADF); /* XXX this can't be right */
+ return (EBADF);
if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
error = ESPIPE;
else if (offset < 0 && fp->f_vnode->v_type != VCHR)
OpenPOWER on IntegriCloud