summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-25 21:50:29 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-25 21:50:29 +0200
commit1ea5ef8944db5da3ff9eeb2d72bcf8a887599925 (patch)
treed6c209f265bccd99c07caa8726ec96c6296158c4
parent6785e06f2b062616d190b043a18fd40826b21043 (diff)
downloadfastd-1ea5ef8944db5da3ff9eeb2d72bcf8a887599925.tar
fastd-1ea5ef8944db5da3ff9eeb2d72bcf8a887599925.zip
epoll: update time *after* waiting...
-rw-r--r--src/poll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/poll.c b/src/poll.c
index 2a2ef34..4ccf7de 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -158,8 +158,6 @@ void fastd_poll_handle(void) {
if (timeout < 0 || timeout > maintenance_timeout)
timeout = maintenance_timeout;
- fastd_update_time();
-
struct epoll_event events[16];
int ret = epoll_wait(ctx.epoll_fd, events, 16, timeout);
if (ret < 0) {
@@ -169,6 +167,8 @@ void fastd_poll_handle(void) {
exit_errno("epoll_wait");
}
+ fastd_update_time();
+
size_t i;
for (i = 0; i < (size_t)ret; i++) {
if (events[i].data.ptr == &ctx.tunfd) {