Return error from fget_write() rather than hardcoding EBADF now that
fget_write() DTRT. Requested by: bde
This commit is contained in:
parent
38f63f7e47
commit
af56abaab5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154073
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user