From 3bcc63994d2161d13a723601b646ddf345c06251 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 25 Feb 2004 23:30:56 +0000 Subject: [PATCH] Update comment regarding MAC labels: we no longer pass endpoints into the MAC Framework, just the pipe pair. GC 'hadpeer' used in pipedestroy(), which is no longer needed as we check pipe_present flags on the pair. --- sys/kern/sys_pipe.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 79a9804a9988..2a5479f023be 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -316,10 +316,9 @@ pipe(td, uap) pp = uma_zalloc(pipe_zone, M_WAITOK); #ifdef MAC /* - * struct pipe represents a pipe endpoint. The MAC label is shared - * between the connected endpoints. As a result mac_init_pipe() and - * mac_create_pipe() should only be called on one of the endpoints - * after they have been connected. + * The MAC label is shared between the connected endpoints. As a + * result mac_init_pipe() and mac_create_pipe() are called once + * for the pair, and not on the endpoints. */ mac_init_pipe(pp); mac_create_pipe(td->td_ucred, pp); @@ -1459,11 +1458,9 @@ pipeclose(cpipe) { struct pipepair *pp; struct pipe *ppipe; - int hadpeer; KASSERT(cpipe != NULL, ("pipeclose: cpipe == NULL")); - hadpeer = 0; PIPE_LOCK(cpipe); pp = cpipe->pipe_pair; @@ -1486,7 +1483,6 @@ pipeclose(cpipe) */ ppipe = cpipe->pipe_peer; if (ppipe->pipe_present != 0) { - hadpeer++; pipeselwakeup(ppipe); ppipe->pipe_state |= PIPE_EOF;