tcp: break the timeout loop early when tvheadend is in the shutdown phase

This commit is contained in:
Jaroslav Kysela 2014-06-02 08:13:12 +02:00
parent d9d9531d86
commit a4300bee58

View file

@ -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;