From: Jaroslav Kysela Date: Mon, 23 May 2016 19:11:17 +0000 (+0200) Subject: gtimer: fix the ts.tv_sec assignment - coverity X-Git-Tag: v4.2.1~487 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea841ce1dedf48247c923b91937509dca0d7fc60;p=thirdparty%2Ftvheadend.git gtimer: fix the ts.tv_sec assignment - coverity --- diff --git a/src/main.c b/src/main.c index 8aaa8d9e3..13ee44a6f 100644 --- a/src/main.c +++ b/src/main.c @@ -654,6 +654,8 @@ mainloop(void) while (tvheadend_is_running()) { now = gdispatch_clock_update(); + ts.tv_sec = now + 3600; + ts.tv_nsec = 0; /* Global timers */ pthread_mutex_lock(&global_lock); @@ -667,9 +669,6 @@ mainloop(void) tvhdebug("gtimer", " gti %p expire %"PRItimet, gti, gti->gti_expire.tv_sec); #endif - ts.tv_sec += 3600; - ts.tv_nsec = 0; - while((gti = LIST_FIRST(>imers)) != NULL) { if (gti->gti_expire > now) {