aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2004-02-25 23:30:56 +0000
committerRobert Watson <rwatson@FreeBSD.org>2004-02-25 23:30:56 +0000
commit094bdd260c4a401e67de381f146681edde6dd334 (patch)
tree4186e6518abdac86ed9ef6289ad280557a77670d /sys/kern/sys_pipe.c
parent937f5a8e02e440399652582af0742158910853f5 (diff)
downloadsrc-094bdd260c4a401e67de381f146681edde6dd334.tar.gz
src-094bdd260c4a401e67de381f146681edde6dd334.zip
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.
Notes
Notes: svn path=/head/; revision=126249
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c10
1 files 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;