X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetwork.c;h=abed5b8771bc333f4fc44391f227fc4e81a6bc74;hb=a396da422740caf336a6d594515e8d80de6f440a;hp=270bed29405c1778361600080e1b70f8d2d5caa4;hpb=f25d207699e013bb47c0083fe56b8358a98f6f4d;p=collectd.git diff --git a/src/network.c b/src/network.c index 270bed29..abed5b87 100644 --- a/src/network.c +++ b/src/network.c @@ -267,16 +267,16 @@ static size_t network_config_packet_size = 1452; static bool network_config_forward; static bool network_config_stats; -static sockent_t *sending_sockets = NULL; +static sockent_t *sending_sockets; -static receive_list_entry_t *receive_list_head = NULL; -static receive_list_entry_t *receive_list_tail = NULL; +static receive_list_entry_t *receive_list_head; +static receive_list_entry_t *receive_list_tail; static pthread_mutex_t receive_list_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t receive_list_cond = PTHREAD_COND_INITIALIZER; static uint64_t receive_list_length = 0; -static sockent_t *listen_sockets = NULL; -static struct pollfd *listen_sockets_pollfd = NULL; +static sockent_t *listen_sockets; +static struct pollfd *listen_sockets_pollfd; static size_t listen_sockets_num = 0; /* The receive and dispatch threads will run as long as `listen_loop' is set to @@ -1924,7 +1924,7 @@ static int sockent_client_connect(sockent_t *se) /* {{{ */ struct sockent_client *client; struct addrinfo *ai_list; int status; - bool reconnect = 0; + bool reconnect = false; cdtime_t now; if ((se == NULL) || (se->type != SOCKENT_TYPE_CLIENT)) @@ -1938,7 +1938,7 @@ static int sockent_client_connect(sockent_t *se) /* {{{ */ "next_resolve_reconnect = %lf", CDTIME_T_TO_DOUBLE(client->resolve_interval), CDTIME_T_TO_DOUBLE(client->next_resolve_reconnect)); - reconnect = 1; + reconnect = true; } if (client->fd >= 0 && !reconnect) /* already connected and not stale*/ @@ -3102,7 +3102,7 @@ static int network_init(void) { * nothing more to do (for now, that is). */ if (have_init) return 0; - have_init = 1; + have_init = true; if (network_config_stats) plugin_register_read("network", network_stats_read);