]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
cwc: do not show error on read in the shutdown phase
authorJaroslav Kysela <perex@perex.cz>
Mon, 2 Jun 2014 06:16:50 +0000 (08:16 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 2 Jun 2014 06:18:30 +0000 (08:18 +0200)
src/descrambler/cwc.c

index a481a6a414310336f566f83466cb7431801a5032..a72b080c8df87dca72346b093554d7f80a1131ab 100755 (executable)
@@ -955,7 +955,7 @@ cwc_read(cwc_t *cwc, void *buf, size_t len, int timeout)
   r = tcp_read_timeout(cwc->cwc_fd, buf, len, timeout);
   pthread_mutex_lock(&cwc_mutex);
 
-  if (r)
+  if (r && tvheadend_running)
     tvhwarn("cwc", "read error %d (%s)", r, strerror(r));
 
   if(cwc_must_break(cwc))
@@ -975,15 +975,17 @@ cwc_read_message(cwc_t *cwc, const char *state, int timeout)
   int msglen, r;
 
   if((r = cwc_read(cwc, buf, 2, timeout))) {
-    tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Read error (header): %s",
-          cwc->cwc_hostname, cwc->cwc_port, state, strerror(r));
+    if (tvheadend_running)
+      tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Read error (header): %s",
+            cwc->cwc_hostname, cwc->cwc_port, state, strerror(r));
     return -1;
   }
 
   msglen = (buf[0] << 8) | buf[1];
   if(msglen >= CWS_NETMSGSIZE) {
-    tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Invalid message size: %d",
-          cwc->cwc_hostname, cwc->cwc_port, state, msglen);
+    if (tvheadend_running)
+      tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Invalid message size: %d",
+            cwc->cwc_hostname, cwc->cwc_port, state, msglen);
     return -1;
   }
 
@@ -991,8 +993,9 @@ cwc_read_message(cwc_t *cwc, const char *state, int timeout)
      so just wait 1 second here */
 
   if((r = cwc_read(cwc, cwc->cwc_buf + 2, msglen, 1000))) {
-    tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Read error: %s",
-          cwc->cwc_hostname, cwc->cwc_port, state, strerror(r));
+    if (tvheadend_running)
+      tvhlog(LOG_INFO, "cwc", "%s:%i: %s: Read error: %s",
+            cwc->cwc_hostname, cwc->cwc_port, state, strerror(r));
     return -1;
   }