From 7b1ee68ef1c921a40e0498997c369f121aff4bfe Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 15 Sep 2014 22:13:13 +0100 Subject: [PATCH] Remove compilation warnings for various configurations. --- src/loop.c | 10 +++++++++- src/mosquitto.c | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/loop.c b/src/loop.c index 21b41588..42d20894 100644 --- a/src/loop.c +++ b/src/loop.c @@ -57,8 +57,12 @@ static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pol int mosquitto_main_loop(struct mosquitto_db *db, int *listensock, int listensock_count, int listener_max) { +#ifdef WITH_SYS_TREE time_t start_time = mosquitto_time(); +#endif +#ifdef WITH_PERSISTENCE time_t last_backup = mosquitto_time(); +#endif time_t last_store_clean = mosquitto_time(); time_t now = 0; time_t now_time; @@ -99,7 +103,11 @@ int mosquitto_main_loop(struct mosquitto_db *db, int *listensock, int listensock } #endif - context_count = HASH_CNT(hh_sock, db->contexts_by_sock) + HASH_CNT(hh_bridge, db->contexts_bridge); + context_count = HASH_CNT(hh_sock, db->contexts_by_sock); +#ifdef WITH_BRIDGE + context_count += HASH_CNT(hh_bridge, db->contexts_bridge); +#endif + if(listensock_count + context_count > pollfd_count || !pollfds){ pollfd_count = listensock_count + context_count; pollfds = _mosquitto_realloc(pollfds, sizeof(struct pollfd)*pollfd_count); diff --git a/src/mosquitto.c b/src/mosquitto.c index 168b1006..4be46938 100644 --- a/src/mosquitto.c +++ b/src/mosquitto.c @@ -153,7 +153,9 @@ int main(int argc, char *argv[]) int listensock_count = 0; int listensock_index = 0; struct mqtt3_config config; +#ifdef WITH_SYS_TREE char buf[1024]; +#endif int i, j; FILE *pid; int listener_max;