mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
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
This commit is contained in:
parent
e2bf77c5c2
commit
e730167f16
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154064
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user