Return error from fget_write() rather than hardcoding EBADF now that

fget_write() DTRT.

Requested by:	bde
This commit is contained in:
John Baldwin 2006-01-06 16:34:22 +00:00
parent 38f63f7e47
commit af56abaab5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154073
2 changed files with 3 additions and 3 deletions

View File

@ -398,7 +398,7 @@ kern_writev(struct thread *td, int fd, struct uio *auio)
error = fget_write(td, fd, &fp);
if (error)
return (EBADF);
return (error);
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);
return (error);
if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
error = ESPIPE;
else if (offset < 0 && fp->f_vnode->v_type != VCHR)

View File

@ -1447,7 +1447,7 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj,
uma_zfree(aiocb_zone, aiocbe);
if (type == 0)
suword(&job->_aiocb_private.error, EBADF);
return (EBADF);
return (error);
}
aiocbe->fd_file = fp;