diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-07-30 13:24:15 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2024-07-30 13:24:15 +0000 |
commit | 7261b62c6d6a1161c56824631b6a43b166cc7aaf (patch) | |
tree | 7a6c217fe10b915385c6ee315fd7382101608972 | |
parent | 92d5c03ef86fbd21a84d9425c456f01e6c513817 (diff) | |
download | skalibs-7261b62c6d6a1161c56824631b6a43b166cc7aaf.tar.gz skalibs-7261b62c6d6a1161c56824631b6a43b166cc7aaf.tar.xz skalibs-7261b62c6d6a1161c56824631b6a43b166cc7aaf.zip |
Better iopause_select
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | src/libstddjb/iopause_select.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libstddjb/iopause_select.c b/src/libstddjb/iopause_select.c index 09d007a..823f20b 100644 --- a/src/libstddjb/iopause_select.c +++ b/src/libstddjb/iopause_select.c @@ -49,12 +49,9 @@ int iopause_select (iopause_fd *x, unsigned int len, tain const *deadline, tain if (r > 0) for (unsigned int i = 0 ; i < len ; i++) if (x[i].fd >= 0) { - if (x[i].events & IOPAUSE_READ && FD_ISSET(x[i].fd, &rfds)) - x[i].revents |= IOPAUSE_READ ; - if (x[i].events & IOPAUSE_WRITE && FD_ISSET(x[i].fd, &wfds)) - x[i].revents |= IOPAUSE_WRITE ; - if (x[i].events & IOPAUSE_EXCEPT && FD_ISSET(x[i].fd, &xfds)) - x[i].revents |= x[i].events |= IOPAUSE_EXCEPT ; + if (FD_ISSET(x[i].fd, &rfds)) x[i].revents |= IOPAUSE_READ ; + if (FD_ISSET(x[i].fd, &wfds)) x[i].revents |= IOPAUSE_WRITE ; + if (FD_ISSET(x[i].fd, &xfds)) x[i].revents |= IOPAUSE_EXCEPT | x[i].events ; } return r ; |