From 1ae3aae35193dce25e5534b12a46011ec7912bb4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Aug 2014 16:07:50 +0200 Subject: Use simple int64_t timestamps in ms instead of timespecs --- src/fastd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fastd.c') diff --git a/src/fastd.c b/src/fastd.c index 247b390..8c58718 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -485,7 +485,7 @@ static inline void init(int argc, char *argv[]) { init_config(&status_fd); fastd_update_time(); - ctx.next_maintenance = fastd_in_seconds(MAINTENANCE_INTERVAL); + ctx.next_maintenance = ctx.now + MAINTENANCE_INTERVAL; ctx.unknown_handshakes[0].timeout = ctx.now; #ifdef WITH_DYNAMIC_PEERS @@ -544,13 +544,13 @@ static inline void init(int argc, char *argv[]) { /** Performs periodic maintenance tasks */ static inline void maintenance(void) { - if (!fastd_timed_out(&ctx.next_maintenance)) + if (!fastd_timed_out(ctx.next_maintenance)) return; fastd_socket_handle_binds(); fastd_peer_maintenance(); - ctx.next_maintenance.tv_sec += MAINTENANCE_INTERVAL; + ctx.next_maintenance += MAINTENANCE_INTERVAL; } /** Reaps zombies of asynchronous shell commands. */ -- cgit v1.2.3