Project

General

Profile

Bug #3268 » pollhup02.patch

dillon, 05/10/2021 05:16 PM

View differences:

sys/kern/sys_pipe.c
*/
if (kn->kn_data == 0)
kn->kn_flags |= EV_NODATA;
kn->kn_flags |= EV_EOF;
kn->kn_flags |= EV_EOF | EV_HUP;
ready = 1;
}
......
kn->kn_data = 0;
if (wpb->state & PIPE_CLOSED) {
kn->kn_flags |= (EV_EOF | EV_NODATA);
kn->kn_flags |= EV_EOF | EV_HUP | EV_NODATA;
return (1);
}
......
#endif
if (wpb->state & PIPE_WEOF) {
kn->kn_flags |= (EV_EOF | EV_NODATA);
kn->kn_flags |= EV_EOF | EV_HUP | EV_NODATA;
ready = 1;
}
sys/vfs/fifofs/fifo_vnops.c
so->so_state & SS_ISDISCONNECTED) {
if (kn->kn_data == 0)
kn->kn_flags |= EV_NODATA;
kn->kn_flags |= EV_EOF;
kn->kn_flags |= EV_EOF | EV_HUP;
lwkt_reltoken(&vp->v_token);
return (1);
}
kn->kn_flags &= ~(EV_EOF | EV_NODATA);
kn->kn_flags &= ~(EV_EOF | EV_HUP | EV_NODATA);
lwkt_reltoken(&vp->v_token);
return (kn->kn_data > 0);
}
......
lwkt_gettoken(&vp->v_token);
kn->kn_data = ssb_space(&so->so_snd);
if (so->so_state & SS_ISDISCONNECTED) {
kn->kn_flags |= (EV_EOF | EV_NODATA);
kn->kn_flags |= EV_EOF | EV_HUP | EV_NODATA;
lwkt_reltoken(&vp->v_token);
return (1);
}
kn->kn_flags &= ~(EV_EOF | EV_NODATA);
kn->kn_flags &= ~(EV_EOF | EV_HUP | EV_NODATA);
lwkt_reltoken(&vp->v_token);
return (kn->kn_data >= so->so_snd.ssb_lowat);
}
(3-3/3)