]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
eloop: Simplify ppoll a little
authorRoy Marples <roy@marples.name>
Fri, 14 Nov 2025 15:05:39 +0000 (15:05 +0000)
committerRoy Marples <roy@marples.name>
Fri, 14 Nov 2025 15:05:39 +0000 (15:05 +0000)
src/eloop.c

index ed0fa9e791fa9af7dd6274ec9fac4fae5ad25057..6c162613551283d4241b6ecf9d56f3509920de77 100644 (file)
@@ -1029,17 +1029,7 @@ eloop_run_ppoll(struct eloop *eloop, const struct timespec *ts)
                        continue;
                if (e->pollfd->revents) {
                        nn--;
-                       events = 0;
-                       if (pfd->revents & POLLIN)
-                               events |= ELE_READ;
-                       if (pfd->revents & POLLOUT)
-                               events |= ELE_WRITE;
-                       if (pfd->revents & POLLHUP)
-                               events |= ELE_HANGUP;
-                       if (pfd->revents & POLLERR)
-                               events |= ELE_ERROR;
-                       if (pfd->revents & POLLNVAL)
-                               events |= ELE_NVAL;
+                       events = eloop_pollevents(pfd);
                        if (events)
                                e->cb(e->cb_arg, events);
                }