]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
gtimer: fix the ts.tv_sec assignment - coverity
authorJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:11:17 +0000 (21:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:11:17 +0000 (21:11 +0200)
src/main.c

index 8aaa8d9e3a01b08b3f1931e26fc253bafcaa9abd..13ee44a6ffa4f5636027950bbf2484f94ad4d598 100644 (file)
@@ -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(&gtimers)) != NULL) {
       
       if (gti->gti_expire > now) {