Pipes are not writeable while a direct write is in progress. However,

the kqueue filter got the sense of the test reversed, so fix it.

Spotted by:	Michael Elkins <me@sigpipe.org>
This commit is contained in:
Jonathan Lemon 2000-09-14 20:10:19 +00:00
parent 07ef427609
commit 6f451c99b3

View File

@ -1222,7 +1222,7 @@ filt_pipewrite(struct knote *kn, long hint)
return (1);
}
kn->kn_data = wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt;
if ((wpipe->pipe_state & PIPE_DIRECTW) == 0)
if (wpipe->pipe_state & PIPE_DIRECTW)
kn->kn_data = 0;
return (kn->kn_data >= PIPE_BUF);