Index: head/sys/kern/sys_pipe.c =================================================================== --- head/sys/kern/sys_pipe.c +++ head/sys/kern/sys_pipe.c @@ -946,9 +946,10 @@ retry: PIPE_LOCK_ASSERT(wpipe, MA_OWNED); error = pipelock(wpipe, 1); - if (wpipe->pipe_state & PIPE_EOF) + if (error != 0) + goto error1; + if ((wpipe->pipe_state & PIPE_EOF) != 0) { error = EPIPE; - if (error) { pipeunlock(wpipe); goto error1; }