From: Bruno Prémont Date: Fri, 18 Mar 2011 07:24:40 +0000 (+0100) Subject: Fix compilation error with plugin_register_shutdown X-Git-Tag: collectd-4.9.5~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f9451f7f6e794e7f42ef8f4b1c5551537b848272;p=collectd.git Fix compilation error with plugin_register_shutdown Compiling collectd-4.10.2 on an OpenSuSE 11.3 system causes the following error: snmp.c: In function ‘module_register’: snmp.c:1620:3: error: passing argument 1 of ‘plugin_register_shutdown’ discards qualifiers from pointer target type plugin.h:275:5: note: expected ‘char *’ but argument is of type ‘const char *’ Convert plugin_register_shutdown's name argument from 'char *' to 'const char *' in order to match the other plugin_register_* functions. Signed-off-by: Bruno Prémont Signed-off-by: Florian Forster --- diff --git a/src/plugin.c b/src/plugin.c index 492be214..d5f83c55 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -846,7 +846,7 @@ int plugin_register_flush (const char *name, (void *) callback, ud)); } /* int plugin_register_flush */ -int plugin_register_shutdown (char *name, +int plugin_register_shutdown (const char *name, int (*callback) (void)) { return (create_register_callback (&list_shutdown, name, diff --git a/src/plugin.h b/src/plugin.h index 868f44ab..06f023e9 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -272,7 +272,7 @@ int plugin_register_write (const char *name, plugin_write_cb callback, user_data_t *user_data); int plugin_register_flush (const char *name, plugin_flush_cb callback, user_data_t *user_data); -int plugin_register_shutdown (char *name, +int plugin_register_shutdown (const char *name, plugin_shutdown_cb callback); int plugin_register_data_set (const data_set_t *ds); int plugin_register_log (const char *name,