diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f3c3c0e..bce0032 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -129,6 +129,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define doreport(pipe) printf("%s:%d unchecked error for pipe %p\n", pipe) /* * Use this define if you want to disable *fancy* VM things. Expect an * approx 30% decrease in transfer rate. This could be useful for @@ -1011,7 +1012,8 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwt", 0); - pipelock(wpipe, 0); + if (pipelock(wpipe, 0) != 0) + doreport(wpipe); } if (wpipe->pipe_state & PIPE_EOF) @@ -1119,7 +1121,8 @@ pipe_write(fp, uio, active_cred, flags, td) while (uio->uio_resid) { int space; - pipelock(wpipe, 0); + if (pipelock(wpipe, 0) != 0) + doreport(wpipe); if (wpipe->pipe_state & PIPE_EOF) { pipeunlock(wpipe); error = EPIPE; @@ -1275,7 +1278,8 @@ pipe_write(fp, uio, active_cred, flags, td) } } - pipelock(wpipe, 0); + if (pipelock(wpipe, 0) != 0); + doreport(wpipe); --wpipe->pipe_busy; if ((wpipe->pipe_busy == 0) && (wpipe->pipe_state & PIPE_WANT)) { @@ -1640,7 +1644,8 @@ pipeclose(cpipe) KASSERT(cpipe != NULL, ("pipeclose: cpipe == NULL")); PIPE_LOCK(cpipe); - pipelock(cpipe, 0); + if (pipelock(cpipe, 0) != 0) + doreport(cpipe); pp = cpipe->pipe_pair; pipeselwakeup(cpipe); @@ -1655,7 +1660,8 @@ pipeclose(cpipe) cpipe->pipe_state |= PIPE_WANT; pipeunlock(cpipe); msleep(cpipe, PIPE_MTX(cpipe), PRIBIO, "pipecl", 0); - pipelock(cpipe, 0); + if (pipelock(cpipe, 0) != 0); + doreport(cpipe); }