From: Ruben Kerkhof Date: Sat, 31 Dec 2016 14:11:18 +0000 (+0100) Subject: ovs_events: fix build failures on Jessie X-Git-Tag: collectd-5.8.0~245 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ee3387a7e491b9ad671fda500debc9637104dc96;p=collectd.git ovs_events: fix build failures on Jessie src/utils_ovs.c: In function ‘ovs_db_table_update_cb’: src/utils_ovs.c:464:15: error: unused variable ‘table_name’ [-Werror=unused-variable] const char *table_name = NULL; ^~~~~~~~~~ src/utils_ovs.c:463:10: error: unused variable ‘obj_len’ [-Werror=unused-variable] size_t obj_len = 0; ^~~~~~~ src/utils_ovs.c:462:12: error: unused variable ‘jtable_update’ [-Werror=unused-variable] yajl_val jtable_update; ^~~~~~~~~~~~~ src/utils_ovs.c: In function ‘ovs_db_reconnect’: src/utils_ovs.c:713:22: error: unused variable ‘saunix’ [-Werror=unused-variable] struct sockaddr_un saunix; ^~~~~~ src/utils_ovs.c:710:14: error: unused variable ‘unix_prefix’ [-Werror=unused-variable] const char unix_prefix[] = "unix:"; ^~~~~~~~~~~ src/utils_ovs.c: In function ‘ovs_yajl_gen_val’: src/utils_ovs.c:373:10: error: ‘yajl_gen_ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return yajl_gen_ret; ^~~~~~~~~~~~ cc1: all warnings being treated as errors --- diff --git a/src/utils_ovs.c b/src/utils_ovs.c index ff2b151e..6c90c5e4 100644 --- a/src/utils_ovs.c +++ b/src/utils_ovs.c @@ -328,7 +328,7 @@ static yajl_gen_status ovs_yajl_gen_val(yajl_gen jgen, yajl_val jval) { yajl_val jobj_value = NULL; const char *obj_key = NULL; size_t obj_len = 0; - yajl_gen_status yajl_gen_ret; + yajl_gen_status yajl_gen_ret = yajl_gen_status_ok; if (YAJL_IS_STRING(jval)) OVS_YAJL_CALL(ovs_yajl_gen_tstring, jgen, YAJL_GET_STRING(jval)); @@ -459,9 +459,6 @@ static int ovs_db_table_update_cb(ovs_db_t *pdb, yajl_val jnode) { yajl_val jvalue; yajl_val jparams; yajl_val jtable_updates; - yajl_val jtable_update; - size_t obj_len = 0; - const char *table_name = NULL; const char *params_path[] = {"params", NULL}; const char *id_path[] = {"id", NULL}; @@ -707,10 +704,8 @@ static void ovs_json_reader_free(ovs_json_reader_t *jreader) { * if connection has been established. */ static void ovs_db_reconnect(ovs_db_t *pdb) { - const char unix_prefix[] = "unix:"; const char *node_info = pdb->node; struct addrinfo *result; - struct sockaddr_un saunix; if (pdb->unix_path[0] != '\0') { /* use UNIX socket instead of INET address */