From: Jaroslav Kysela Date: Fri, 3 Oct 2014 13:19:28 +0000 (+0200) Subject: tvhlog: tvhlog_thread - remove dead code (coverity) X-Git-Tag: v4.1~1195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb30be0a6fb2df54263a71942c8cc798ff210d20;p=thirdparty%2Ftvheadend.git tvhlog: tvhlog_thread - remove dead code (coverity) --- diff --git a/src/tvhlog.c b/src/tvhlog.c index 04f79d653..c510fae9f 100644 --- a/src/tvhlog.c +++ b/src/tvhlog.c @@ -222,11 +222,10 @@ tvhlog_thread ( void *p ) tvhlog_msg_t *msg; pthread_mutex_lock(&tvhlog_mutex); - while (1) { + while (tvhlog_run) { /* Wait */ if (!(msg = TAILQ_FIRST(&tvhlog_queue))) { - if (!tvhlog_run) break; if (fp) { fclose(fp); // only issue here is we close with mutex! // but overall performance will be higher @@ -235,7 +234,6 @@ tvhlog_thread ( void *p ) pthread_cond_wait(&tvhlog_cond, &tvhlog_mutex); continue; } - if (!msg) break; TAILQ_REMOVE(&tvhlog_queue, msg, link); tvhlog_queue_size--; if (tvhlog_queue_size < (TVHLOG_QUEUE_MAXSIZE / 2))