From 7bd40e39de0841948dde75f95767c90ab3fff7ac Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 5 Mar 2016 15:17:10 +0100 Subject: [PATCH] configfile.c: constify --- src/daemon/collectd.c | 2 +- src/daemon/configfile.c | 10 +++++----- src/daemon/configfile.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index a745d7d1..a970d03e 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -518,7 +518,7 @@ int main (int argc, char **argv) struct sigaction sig_term_action; struct sigaction sig_usr1_action; struct sigaction sig_pipe_action; - char *configfile = CONFIGFILE; + const char *configfile = CONFIGFILE; int test_config = 0; int test_readall = 0; const char *basedir; diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 89b0be0b..8a7621d2 100644 --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c @@ -72,15 +72,15 @@ typedef struct cf_complex_callback_s typedef struct cf_value_map_s { - char *key; + const char *key; int (*func) (oconfig_item_t *); } cf_value_map_t; typedef struct cf_global_option_s { - char *key; + const char *key; char *value; - char *def; + const char *def; } cf_global_option_t; /* @@ -381,7 +381,7 @@ static int dispatch_value (oconfig_item_t *ci) static int dispatch_block_plugin (oconfig_item_t *ci) { int i; - char *name; + const char *name; cf_complex_callback_t *cb; @@ -1115,7 +1115,7 @@ int cf_register_complex (const char *type, int (*callback) (oconfig_item_t *)) return (0); } /* int cf_register_complex */ -int cf_read (char *filename) +int cf_read (const char *filename) { oconfig_item_t *conf; int i; diff --git a/src/daemon/configfile.h b/src/daemon/configfile.h index 5bc9b305..648246bd 100644 --- a/src/daemon/configfile.h +++ b/src/daemon/configfile.h @@ -87,7 +87,7 @@ int cf_register_complex (const char *type, int (*callback) (oconfig_item_t *)); * Returns zero upon success and non-zero otherwise. A error-message will have * been printed in this case. */ -int cf_read (char *filename); +int cf_read (const char *filename); int global_option_set (const char *option, const char *value); const char *global_option_get (const char *option); -- 2.30.2