From 853242b07852c771e5c3bd3576b962bb70707577 Mon Sep 17 00:00:00 2001 From: leitner Date: Sun, 25 Apr 2021 11:09:25 +0000 Subject: [PATCH] next attempt (I need a bsd shell) --- io/io_waituntil2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/io/io_waituntil2.c b/io/io_waituntil2.c index 8e00fe7..3cb1d61 100644 --- a/io/io_waituntil2.c +++ b/io/io_waituntil2.c @@ -274,13 +274,13 @@ int64 io_waituntil2(int64 milliseconds) { if (!e->canread || e->wantread) { newevents |= POLLIN; - EV_SET(kev, n, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0); ++n; + EV_SET(kev, y[n].ident, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0); ++nkev; e->kernelwantread=1; } else e->kernelwantread=0; if (!e->canwrite || e->wantwrite) { newevents |= POLLOUT; - EV_SET(kev+nkev, n, EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); ++nkev; + EV_SET(kev+nkev, y[n].ident, EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); ++nkev; e->kernelwantwrite=1; } else e->kernelwantwrite=0; @@ -296,7 +296,7 @@ int64 io_waituntil2(int64 milliseconds) { if (!e->canread && (y[n].filter&EVFILT_WRITE)) { if (e->canread) { newevents &= ~POLLIN; - EV_SET(kev+nkev, n, EVFILT_READ, EV_DELETE, 0, 0, 0); ++nkev; + EV_SET(kev+nkev, y[n].ident, EVFILT_READ, EV_DELETE, 0, 0, 0); ++nkev; } else { e->canread=1; if (e->wantread) { @@ -321,7 +321,7 @@ int64 io_waituntil2(int64 milliseconds) { * us alone for now. */ if (e->canwrite) { newevents &= ~POLLOUT; - EV_SET(kev+nkev, n, EVFILT_WRITE, EV_DELETE, 0, 0, 0); ++nkev; + EV_SET(kev+nkev, y[n].ident, EVFILT_WRITE, EV_DELETE, 0, 0, 0); ++nkev; e->kernelwantwrite=0; } else { /* If !e->wantwrite: The laziness optimization in