From 257309730c0934f4bdbd8f8e37c33380bf7f3f60 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Tue, 1 Jul 2014 17:29:45 +0200 Subject: [PATCH] openldap: revert change leading to use of uninitialised variable this was preventing build with -Wall --- src/openldap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openldap.c b/src/openldap.c index fd029f49..5a045781 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -218,6 +218,7 @@ static int ldap_read_host (user_data_t *ud) /* {{{ */ unsigned long long counter = 0; unsigned long long opc = 0; unsigned long long opi = 0; + unsigned long long info = 0; struct berval counter_data; struct berval opc_data; @@ -258,8 +259,7 @@ static int ldap_read_host (user_data_t *ud) /* {{{ */ "monitoredInfo")) != NULL) { info_data = *info_list[0]; - // don't convert search result to long long at this point, - // because this field is often populated with non-numerical data. + info = atoll (info_data.bv_val); } if (strcmp (dn, "cn=Total,cn=Connections,cn=Monitor") @@ -448,35 +448,35 @@ static int ldap_read_host (user_data_t *ud) /* {{{ */ == 0) { ldap_submit_gauge ("threads", "threads-open", - atoll (info_data.bv_val), st); + info, st); } else if (strcmp (dn, "cn=Starting,cn=Threads,cn=Monitor") == 0) { ldap_submit_gauge ("threads", "threads-starting", - atoll (info_data.bv_val), st); + info, st); } else if (strcmp (dn, "cn=Active,cn=Threads,cn=Monitor") == 0) { ldap_submit_gauge ("threads", "threads-active", - atoll (info_data.bv_val), st); + info, st); } else if (strcmp (dn, "cn=Pending,cn=Threads,cn=Monitor") == 0) { ldap_submit_gauge ("threads", "threads-pending", - atoll (info_data.bv_val), st); + info, st); } else if (strcmp (dn, "cn=Backload,cn=Threads,cn=Monitor") == 0) { ldap_submit_gauge ("threads", "threads-backload", - atoll (info_data.bv_val), st); + info, st); } else if (strcmp (dn, "cn=Read,cn=Waiters,cn=Monitor") -- 2.11.0