Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern PR/27185: Christian Biere: kqueue: EOF on pipe gain...
details: https://anonhg.NetBSD.org/src/rev/d0f9b4e993c5
branches: trunk
changeset: 584219:d0f9b4e993c5
user: christos <christos%NetBSD.org@localhost>
date: Sun Sep 11 17:55:26 2005 +0000
description:
PR/27185: Christian Biere: kqueue: EOF on pipe gains no EVFILT_READ event
Set the PIPE_EOF flag before we wakeup() our peer. While here GC unused
argument from pipeselwakeup() and call it even when fp == NULL.
diffstat:
sys/kern/sys_pipe.c | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
diffs (125 lines):
diff -r d703526091d2 -r d0f9b4e993c5 sys/kern/sys_pipe.c
--- a/sys/kern/sys_pipe.c Sun Sep 11 17:39:12 2005 +0000
+++ b/sys/kern/sys_pipe.c Sun Sep 11 17:55:26 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_pipe.c,v 1.65 2005/04/01 11:59:37 yamt Exp $ */
+/* $NetBSD: sys_pipe.c,v 1.66 2005/09/11 17:55:26 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.65 2005/04/01 11:59:37 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.66 2005/09/11 17:55:26 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -187,8 +187,7 @@
static int pipe_create(struct pipe **pipep, int allockva);
static int pipelock(struct pipe *pipe, int catch);
static __inline void pipeunlock(struct pipe *pipe);
-static void pipeselwakeup(struct pipe *pipe, struct pipe *sigp, void *data,
- int code);
+static void pipeselwakeup(struct pipe *pipe, struct pipe *sigp, int code);
#ifndef PIPE_NODIRECT
static int pipe_direct_write(struct file *fp, struct pipe *wpipe,
struct uio *uio);
@@ -396,9 +395,8 @@
* 'sigpipe' side of pipe.
*/
static void
-pipeselwakeup(selp, sigp, data, code)
+pipeselwakeup(selp, sigp, code)
struct pipe *selp, *sigp;
- void *data;
int code;
{
int band;
@@ -563,8 +561,7 @@
/*
* We want to read more, wake up select/poll.
*/
- pipeselwakeup(rpipe, rpipe->pipe_peer, fp->f_data,
- POLL_IN);
+ pipeselwakeup(rpipe, rpipe->pipe_peer, POLL_IN);
/*
* If the "write-side" is blocked, wake it up now.
@@ -616,7 +613,7 @@
*/
if ((bp->size - bp->cnt) >= PIPE_BUF
&& (ocnt != bp->cnt || (rpipe->pipe_state & PIPE_SIGNALR))) {
- pipeselwakeup(rpipe, rpipe->pipe_peer, fp->f_data, POLL_OUT);
+ pipeselwakeup(rpipe, rpipe->pipe_peer, POLL_OUT);
rpipe->pipe_state &= ~PIPE_SIGNALR;
}
@@ -774,7 +771,7 @@
wpipe->pipe_state &= ~PIPE_WANTR;
wakeup(wpipe);
}
- pipeselwakeup(wpipe, wpipe, fp->f_data, POLL_IN);
+ pipeselwakeup(wpipe, wpipe, POLL_IN);
error = ltsleep(wpipe, PSOCK | PCATCH, "pipdwt", 0,
&wpipe->pipe_slock);
if (error == 0 && wpipe->pipe_state & PIPE_EOF)
@@ -794,7 +791,7 @@
pipe_loan_free(wpipe);
if (error) {
- pipeselwakeup(wpipe, wpipe, fp->f_data, POLL_ERR);
+ pipeselwakeup(wpipe, wpipe, POLL_ERR);
/*
* If nothing was read from what we offered, return error
@@ -1038,8 +1035,7 @@
* wake up select/poll.
*/
if (bp->cnt)
- pipeselwakeup(wpipe, wpipe, fp->f_data,
- POLL_OUT);
+ pipeselwakeup(wpipe, wpipe, POLL_OUT);
PIPE_LOCK(wpipe);
pipeunlock(wpipe);
@@ -1091,7 +1087,7 @@
* is only done synchronously), so check only wpipe->pipe_buffer.cnt
*/
if (bp->cnt)
- pipeselwakeup(wpipe, wpipe, fp->f_data, POLL_OUT);
+ pipeselwakeup(wpipe, wpipe, POLL_OUT);
/*
* Arrange for next read(2) to do a signal.
@@ -1326,16 +1322,16 @@
retry:
PIPE_LOCK(pipe);
- if (fp)
- pipeselwakeup(pipe, pipe, fp->f_data, POLL_HUP);
+ pipeselwakeup(pipe, pipe, POLL_HUP);
/*
* If the other side is blocked, wake it up saying that
* we want to close it down.
*/
+ pipe->pipe_state |= PIPE_EOF;
while (pipe->pipe_busy) {
wakeup(pipe);
- pipe->pipe_state |= PIPE_WANTCLOSE | PIPE_EOF;
+ pipe->pipe_state |= PIPE_WANTCLOSE;
ltsleep(pipe, PSOCK, "pipecl", 0, &pipe->pipe_slock);
}
@@ -1348,8 +1344,7 @@
PIPE_UNLOCK(pipe);
goto retry;
}
- if (fp)
- pipeselwakeup(ppipe, ppipe, fp->f_data, POLL_HUP);
+ pipeselwakeup(ppipe, ppipe, POLL_HUP);
ppipe->pipe_state |= PIPE_EOF;
wakeup(ppipe);
Home |
Main Index |
Thread Index |
Old Index