Lines 1788-1795
filt_pipedetach(struct knote *kn)
Link Here
|
1788 |
static int |
1788 |
static int |
1789 |
filt_piperead(struct knote *kn, long hint) |
1789 |
filt_piperead(struct knote *kn, long hint) |
1790 |
{ |
1790 |
{ |
|
|
1791 |
struct file *fp = kn->kn_fp; |
1791 |
struct pipe *rpipe = kn->kn_hook; |
1792 |
struct pipe *rpipe = kn->kn_hook; |
1792 |
struct pipe *wpipe = rpipe->pipe_peer; |
|
|
1793 |
int ret; |
1793 |
int ret; |
1794 |
|
1794 |
|
1795 |
PIPE_LOCK_ASSERT(rpipe, MA_OWNED); |
1795 |
PIPE_LOCK_ASSERT(rpipe, MA_OWNED); |
Lines 1797-1805
filt_piperead(struct knote *kn, long hint)
Link Here
|
1797 |
if ((kn->kn_data == 0) && (rpipe->pipe_state & PIPE_DIRECTW)) |
1797 |
if ((kn->kn_data == 0) && (rpipe->pipe_state & PIPE_DIRECTW)) |
1798 |
kn->kn_data = rpipe->pipe_map.cnt; |
1798 |
kn->kn_data = rpipe->pipe_map.cnt; |
1799 |
|
1799 |
|
1800 |
if ((rpipe->pipe_state & PIPE_EOF) || |
1800 |
if ((rpipe->pipe_state & PIPE_EOF) && |
1801 |
wpipe->pipe_present != PIPE_ACTIVE || |
1801 |
!((rpipe->pipe_state & PIPE_NAMED) && |
1802 |
(wpipe->pipe_state & PIPE_EOF)) { |
1802 |
(fp->f_seqcount == rpipe->pipe_wgen))) { |
1803 |
kn->kn_flags |= EV_EOF; |
1803 |
kn->kn_flags |= EV_EOF; |
1804 |
return (1); |
1804 |
return (1); |
1805 |
} |
1805 |
} |