From 9e092a91bc354f6e101e36eff2a0f4edcda25f24 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 5 Mar 2014 15:03:50 +0100 Subject: [PATCH] Fixes for graceful exit patch Mostly avahi related and cosmetic fixes for the graceful exit patch. --- src/avahi.c | 5 +++-- src/epgdb.c | 4 ++-- src/htsp_server.c | 1 - src/tcp.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/avahi.c b/src/avahi.c index e290f818..c84a2f21 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -248,13 +249,13 @@ client_callback(AvahiClient *c, AvahiClientState state, void *userdata) static void * avahi_thread(void *aux) { - const AvahiPoll *ap = avahi_simple_poll_get(asp); + const AvahiPoll *ap = avahi_simple_poll_get(avahi_asp); name = avahi_strdup("Tvheadend"); avahi_client_new(ap, AVAHI_CLIENT_NO_FAIL, client_callback, NULL, NULL); - while(avahi_simple_poll_iterate(asp, -1) == 0); + while(avahi_simple_poll_iterate(avahi_asp, -1) == 0); return NULL; diff --git a/src/epgdb.c b/src/epgdb.c index ec576d3d..db70347f 100644 --- a/src/epgdb.c +++ b/src/epgdb.c @@ -100,8 +100,8 @@ static void _epgdb_v1_process ( htsmsg_t *c, epggrab_stats_t *stats ) /* * Process v2 data */ -static void _epgdb_v2_process ( - char **sect, htsmsg_t *m, epggrab_stats_t *stats ) +static void +_epgdb_v2_process( char **sect, htsmsg_t *m, epggrab_stats_t *stats ) { int save = 0; const char *s; diff --git a/src/htsp_server.c b/src/htsp_server.c index 45cccfc4..c62283c8 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -1989,7 +1989,6 @@ htsp_read_loop(htsp_connection_t *htsp) while(tvheadend_running) { readmsg: - tvhlog(LOG_INFO, "htsp", "read_loop"); if((r = htsp_read_message(htsp, &m, 0)) != 0) return r; diff --git a/src/tcp.c b/src/tcp.c index 136a842e..05b9c004 100644 --- a/src/tcp.c +++ b/src/tcp.c @@ -695,7 +695,7 @@ tcp_server_done(void) char c = 'E'; tcp_server_running = 0; - write(tcp_server_pipe.wr, &c, 1); + tvh_write(tcp_server_pipe.wr, &c, 1); pthread_mutex_lock(&global_lock); LIST_FOREACH(tsl, &tcp_server_active, alink) {