don't allow reading from files that haven't been open'd for reading.

This commit is contained in:
jmg 2003-10-24 21:07:53 +00:00
parent 7d3a70bca2
commit abe50d83e6

View File

@ -1330,8 +1330,9 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ
}
fp = aiocbe->fd_file = fdp->fd_ofiles[fd];
if ((fp == NULL) || ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) ==
0))) {
if ((fp == NULL) ||
((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == 0)) ||
((opcode == LIO_READ) && ((fp->f_flag & FREAD) == 0))) {
FILEDESC_UNLOCK(fdp);
uma_zfree(aiocb_zone, aiocbe);
if (type == 0)