From: Marc Fournier Date: Wed, 20 Aug 2014 08:13:14 +0000 (+0200) Subject: openldap: initialize LDAP library before collectd goes multi-threaded X-Git-Tag: collectd-5.5.0~152^2~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=67e5482e617b3885c60d96cf5028f8e8aee21ce7;p=collectd.git openldap: initialize LDAP library before collectd goes multi-threaded --- diff --git a/src/openldap.c b/src/openldap.c index e6e1c646..9763a06c 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -738,7 +738,18 @@ static int ldap_config (oconfig_item_t *ci) /* {{{ */ /* }}} End of configuration handling functions */ +static int ldap_init (void) /* {{{ */ +{ + /* Initialize LDAP library while still single-threaded as recommended in + * ldap_initialize(3) */ + int debug_level; + ldap_get_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug_level); + return (0); + +} /* }}} int ldap_init */ + void module_register (void) /* {{{ */ { plugin_register_complex_config ("openldap", ldap_config); + plugin_register_init ("openldap", ldap_init); } /* }}} void module_register */