Don't forget to bypass vnodes in corner cases.

Found by:	kkenn and ports/shell/zsh
Thanks to:	jeffr
This commit is contained in:
Poul-Henning Kamp 2004-12-13 10:07:57 +00:00
parent 1cc7d59e34
commit 5cb471d04d

View File

@ -276,17 +276,15 @@ fifo_open(ap)
* a reader. That (and not still having one)
* is the condition that we must wait for.
*/
return (0);
mtx_lock(&fifo_mtx);
}
}
mtx_unlock(&fifo_mtx);
if (ap->a_fdidx >= 0) {
fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
if (fp->f_ops == &badfileops) {
fp->f_ops = &fifo_ops_f;
fp->f_data = fip;
}
}
KASSERT(ap->a_fdidx >= 0, ("can't fifo/vnode bypass %d", ap->a_fdidx));
fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
KASSERT(fp->f_ops == &badfileops, ("not badfileops in fifo_open"));
fp->f_ops = &fifo_ops_f;
fp->f_data = fip;
return (0);
}