Return error from fget_write() rather than hardcoding EBADF now that
fget_write() DTRT. Requested by: bde
This commit is contained in:
parent
e851a1b52a
commit
0beb1bf77b
@ -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…
x
Reference in New Issue
Block a user