From 59857ead2d439d450afc6f5144c9c08e8d0c8a5c Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 24 Jul 2019 21:12:01 +0200 Subject: Fix issues found by Coverity Scan --- backends/lua.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends') diff --git a/backends/lua.c b/backends/lua.c index 8e221d1..4d946cd 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -61,7 +61,7 @@ static uint32_t lua_interval(){ } static int lua_update_timerfd(){ - uint64_t interval, gcd, residual; + uint64_t interval = 0, gcd, residual; size_t n = 0; #ifdef MMBACKEND_LUA_TIMERFD struct itimerspec timer_config = { @@ -396,11 +396,11 @@ static int lua_handle(size_t num, managed_fd* fds){ return 1; } #else - if(!last_timestamp){ - last_timestamp = mm_timestamp(); - } - delta = mm_timestamp() - last_timestamp; + if(!last_timestamp){ last_timestamp = mm_timestamp(); + } + delta = mm_timestamp() - last_timestamp; + last_timestamp = mm_timestamp(); #endif //no timers active -- cgit v1.2.3