]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tcp: break the timeout loop early when tvheadend is in the shutdown phase
authorJaroslav Kysela <perex@perex.cz>
Mon, 2 Jun 2014 06:13:12 +0000 (08:13 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 2 Jun 2014 06:13:12 +0000 (08:13 +0200)
src/tcp.c

index f2c5e6e49aa1375a0f9f714a7bb9af0acbc25c3e..a9f7e1bffdf722f264974ab195afc34dc0e84bb1 100644 (file)
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -118,6 +118,12 @@ tcp_connect(const char *hostname, int port, const char *bindaddr,
         timeout = 0;
 
       while (1) {
+        if (!tvheadend_running) {
+          tvhpoll_destroy(efd);
+          close(fd);
+          return -1;
+        }
+
         r = tvhpoll_wait(efd, &ev, 1, timeout * 1000);
         if (r > 0)
           break;