-/* $OpenBSD: sys_pipe.c,v 1.132 2021/12/13 14:54:22 visa Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.133 2021/12/13 14:56:55 visa Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
filt_pipeexcept_common(struct knote *kn, struct pipe *rpipe)
{
struct pipe *wpipe;
+ int active = 0;
rw_assert_wrlock(rpipe->pipe_lock);
wpipe = pipe_peer(rpipe);
- if ((rpipe->pipe_state & PIPE_EOF) || wpipe == NULL) {
- kn->kn_flags |= EV_EOF;
- if (kn->kn_flags & __EV_POLL)
+ if (kn->kn_flags & __EV_POLL) {
+ if ((rpipe->pipe_state & PIPE_EOF) || wpipe == NULL) {
kn->kn_flags |= __EV_HUP;
- return (1);
+ active = 1;
+ }
}
- return (0);
+ return (active);
}
int
-/* $OpenBSD: tty_pty.c,v 1.110 2021/10/24 00:02:25 jsg Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.111 2021/12/13 14:56:55 visa Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
{
struct pt_softc *pti = (struct pt_softc *)kn->kn_hook;
struct tty *tp;
+ int active = 0;
tp = pti->pt_tty;
((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl)) {
kn->kn_fflags |= NOTE_OOB;
kn->kn_data = 1;
- return (1);
+ active = 1;
}
- return (0);
}
- if (!ISSET(tp->t_state, TS_CARR_ON)) {
- kn->kn_flags |= EV_EOF;
- if (kn->kn_flags & __EV_POLL)
+
+ if (kn->kn_flags & __EV_POLL) {
+ if (!ISSET(tp->t_state, TS_CARR_ON)) {
kn->kn_flags |= __EV_HUP;
- return (1);
+ active = 1;
+ }
}
- return (0);
+ return (active);
}
const struct filterops ptcread_filtops = {
-/* $OpenBSD: uipc_socket.c,v 1.269 2021/11/11 16:35:09 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.270 2021/12/13 14:56:55 visa Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
kn->kn_data -= so->so_oobmark;
rv = 1;
}
- } else if (so->so_state & SS_CANTRCVMORE) {
- kn->kn_flags |= EV_EOF;
- if (kn->kn_flags & __EV_POLL) {
- if (so->so_state & SS_ISDISCONNECTED)
- kn->kn_flags |= __EV_HUP;
+ }
+
+ if (kn->kn_flags & __EV_POLL) {
+ if (so->so_state & SS_ISDISCONNECTED) {
+ kn->kn_flags |= __EV_HUP;
+ rv = 1;
}
- kn->kn_fflags = so->so_error;
- rv = 1;
}
return rv;
-/* $OpenBSD: fifo_vnops.c,v 1.88 2021/12/13 14:54:22 visa Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.89 2021/12/13 14:56:55 visa Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
soassertlocked(so);
- if (so->so_state & SS_CANTRCVMORE) {
- kn->kn_flags |= EV_EOF;
- if (kn->kn_flags & __EV_POLL) {
- if (so->so_state & SS_ISDISCONNECTED)
- kn->kn_flags |= __EV_HUP;
+ if (kn->kn_flags & __EV_POLL) {
+ if (so->so_state & SS_ISDISCONNECTED) {
+ kn->kn_flags |= __EV_HUP;
+ rv = 1;
}
- rv = 1;
}
return (rv);