while (tvheadend_running) {
n = tvhpoll_wait(http_poll, &ev, 1, -1);
if (n < 0) {
- tvherror("http_client", "tvhpoll_wait() error");
+ if (tvheadend_running)
+ tvherror("http_client", "tvhpoll_wait() error");
break;
} else {
pthread_mutex_lock(&http_lock);
while ( tvheadend_running ) {
nfds = tvhpoll_wait(iptv_poll, &ev, 1, -1);
if ( nfds < 0 ) {
- tvhlog(LOG_ERR, "iptv", "poll() error %s, sleeping 1 second",
- strerror(errno));
- sleep(1);
+ if (tvheadend_running) {
+ tvhlog(LOG_ERR, "iptv", "poll() error %s, sleeping 1 second",
+ strerror(errno));
+ sleep(1);
+ }
continue;
} else if ( nfds == 0 ) {
continue;