aboutsummaryrefslogtreecommitdiffstats
path: root/wg-dynamic-client.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2019-04-24 16:53:05 +0200
committerThomas Gschwantner <tharre3@gmail.com>2019-05-26 01:07:46 +0200
commit5f5a1f683285c9cc3511b872cc996f719b67d36b (patch)
tree004fefaa1f2279c12af8da32bd9d75ae3e58ee5e /wg-dynamic-client.c
parentFix backwards logic in debug logging (diff)
downloadwg-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 'wg-dynamic-client.c')
-rw-r--r--wg-dynamic-client.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/wg-dynamic-client.c b/wg-dynamic-client.c
index f966747..1bef297 100644
--- a/wg-dynamic-client.c
+++ b/wg-dynamic-client.c
@@ -505,7 +505,6 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused)))
}
if (pollfds[0].revents & POLLOUT) {
- pollfds[0].revents &= ~POLLOUT;
debug("sending, trying again with %lu bytes\n",
req.buflen);
off = send_message(pollfds[0].fd, req.buf, &req.buflen);
@@ -516,7 +515,6 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused)))
}
if (pollfds[0].revents & POLLIN) {
- pollfds[0].revents &= ~POLLIN;
if (handle_request(pollfds[0].fd, &req, handle_response,
handle_error))
close_connection(&pollfds[0].fd, &req);