-/* $OpenBSD: sys_generic.c,v 1.155 2023/02/25 09:55:46 mvs Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.156 2023/05/09 14:22:17 visa Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
* __EV_SELECT */
error = 0;
break;
- case EPIPE: /* Specific to pipes */
- KASSERT(kev.filter == EVFILT_WRITE);
- FD_SET(kev.ident, pobits[1]);
- (*ncollected)++;
- error = 0;
- break;
case ENXIO: /* Device has been detached */
default:
goto bad;
goto again;
}
break;
- case EPIPE: /* Specific to pipes */
- KASSERT(kevp->filter == EVFILT_WRITE);
- pl->revents |= POLLHUP;
- break;
default:
DPRINTFN(0, "poll err %lu fd %d revents %02x serial"
" %lu filt %d ERROR=%d\n",
-/* $OpenBSD: sys_pipe.c,v 1.145 2023/02/12 10:41:00 mvs Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.146 2023/05/09 14:22:17 visa Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
break;
case EVFILT_WRITE:
if (wpipe == NULL) {
- /* other end of pipe has been closed */
- error = EPIPE;
- break;
+ /*
+ * The other end of the pipe has been closed.
+ * Since the filter now always indicates a pending
+ * event, attach the knote to the current side
+ * to proceed with the registration.
+ */
+ wpipe = rpipe;
}
kn->kn_fop = &pipe_wfiltops;
kn->kn_hook = wpipe;