diff options
author | Linus Nordberg <linus@nordberg.se> | 2019-04-24 16:53:05 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-05-26 01:07:46 +0200 |
commit | 5f5a1f683285c9cc3511b872cc996f719b67d36b (patch) | |
tree | 004fefaa1f2279c12af8da32bd9d75ae3e58ee5e /wg-dynamic-server.c | |
parent | Fix backwards logic in debug logging (diff) | |
download | wg-dynamic-5f5a1f683285c9cc3511b872cc996f719b67d36b.tar.xz wg-dynamic-5f5a1f683285c9cc3511b872cc996f719b67d36b.zip |
No need to clear bits in pollfd revents
POSIX says:
"In each pollfd structure, poll() shall clear the revents member,
except that where the application requested a report on a condition by
setting one of the bits of events listed above, poll() shall set the
corresponding bit in revents if the requested condition is true."
Diffstat (limited to '')
-rw-r--r-- | wg-dynamic-server.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/wg-dynamic-server.c b/wg-dynamic-server.c index 34fe9bc..2a0c321 100644 --- a/wg-dynamic-server.c +++ b/wg-dynamic-server.c @@ -548,8 +548,6 @@ int main(int argc, char *argv[]) if (!(pollfds[i].revents & POLLOUT)) continue; - pollfds[i].revents &= ~POLLOUT; - off = send_message(pollfds[i].fd, reqs[i - 1].buf, &reqs[i - 1].buflen); if (reqs[i - 1].buflen) @@ -563,7 +561,6 @@ int main(int argc, char *argv[]) if (pollfds[i].fd < 0 || !pollfds[i].revents & POLLIN) continue; - pollfds[i].revents &= ~POLLIN; if (handle_request(pollfds[i].fd, &reqs[i - 1], send_response, send_error)) close_connection(&pollfds[i].fd, &reqs[i - 1]); |