]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tcp: coverity don't close(-1)
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 13:44:43 +0000 (15:44 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 13:44:43 +0000 (15:44 +0200)
src/tcp.c

index 933fb075c1e48d54cceac31b19bb14f59ac11526..d0fde5626ba4aafc50ae734c82d955e1391a1bb0 100644 (file)
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -730,7 +730,8 @@ tcp_server_done(void)
   LIST_FOREACH(tsl, &tcp_server_active, alink) {
     if (tsl->ops.cancel)
       tsl->ops.cancel(tsl->opaque);
-    close(tsl->fd);
+    if (tsl->fd >= 0)
+      close(tsl->fd);
     tsl->fd = -1;
     pthread_kill(tsl->tid, SIGTERM);
   }