command parser: Set command type to UNKNOWN upon failure.
[collectd.git] / src / openldap.c
index d424cb4..dd3226d 100644 (file)
@@ -192,17 +192,13 @@ static void cldap_submit_value (const char *type, const char *type_instance, /*
 static void cldap_submit_derive (const char *type, const char *type_instance, /* {{{ */
                derive_t d, cldap_t *st)
 {
-       value_t v;
-       v.derive = d;
-       cldap_submit_value (type, type_instance, v, st);
+       cldap_submit_value (type, type_instance, (value_t) { .derive = d }, st);
 } /* }}} void cldap_submit_derive */
 
 static void cldap_submit_gauge (const char *type, const char *type_instance, /* {{{ */
                gauge_t g, cldap_t *st)
 {
-       value_t v;
-       v.gauge = g;
-       cldap_submit_value (type, type_instance, v, st);
+       cldap_submit_value (type, type_instance, (value_t) { .gauge = g }, st);
 } /* }}} void cldap_submit_gauge */
 
 static int cldap_read_host (user_data_t *ud) /* {{{ */
@@ -663,15 +659,13 @@ static int cldap_config_add (oconfig_item_t *ci) /* {{{ */
                                        (st->host != NULL) ? st->host : hostname_g,
                                        (st->name != NULL) ? st->name : "default");
 
-                       user_data_t ud = {
-                               .data = st
-                       };
-
                        status = plugin_register_complex_read (/* group = */ NULL,
                                        /* name      = */ callback_name,
                                        /* callback  = */ cldap_read_host,
                                        /* interval  = */ 0,
-                                       /* user_data = */ &ud);
+                                       &(user_data_t) {
+                                               .data = st,
+                                       });
                }
        }