From: Sebastian Harl Date: Mon, 4 Mar 2013 16:27:31 +0000 (+0100) Subject: backends, daemon: Don't shadow global 'socket' and 'daemon' symbols. X-Git-Tag: sysdb-0.1.0~438^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=42ca22a1e3bbf66b8b16bd0c8c73a289b213a0ee;p=sysdb.git backends, daemon: Don't shadow global 'socket' and 'daemon' symbols. --- diff --git a/src/backend/collectd.c b/src/backend/collectd.c index f745fc9..e0e924e 100644 --- a/src/backend/collectd.c +++ b/src/backend/collectd.c @@ -294,7 +294,7 @@ static int sdb_collectd_config_instance(oconfig_item_t *ci) { char *name = NULL; - char *socket = NULL; + char *socket_path = NULL; char cb_name[1024]; @@ -313,14 +313,14 @@ sdb_collectd_config_instance(oconfig_item_t *ci) oconfig_item_t *child = ci->children + i; if (! strcasecmp(child->key, "Socket")) - oconfig_get_string(child, &socket); + oconfig_get_string(child, &socket_path); else fprintf(stderr, "collectd backend: Ignoring unknown config " "option '%s' inside .\n", child->key, name); } - if (! socket) { + if (! socket_path) { fprintf(stderr, "collectd backend: Instance '%s' missing " "the 'Socket' option.\n", name); return -1; @@ -329,7 +329,7 @@ sdb_collectd_config_instance(oconfig_item_t *ci) snprintf(cb_name, sizeof(cb_name), "collectd-%s", name); cb_name[sizeof(cb_name) - 1] = '\0'; - client = sdb_unixsock_client_create(socket); + client = sdb_unixsock_client_create(socket_path); if (! client) { char errbuf[1024]; fprintf(stderr, "collectd backend: Failed to create unixsock client: " diff --git a/src/backend/mk-livestatus.c b/src/backend/mk-livestatus.c index 57fda52..a5126fb 100644 --- a/src/backend/mk-livestatus.c +++ b/src/backend/mk-livestatus.c @@ -238,7 +238,7 @@ static int sdb_livestatus_config_instance(oconfig_item_t *ci) { char *name = NULL; - char *socket = NULL; + char *socket_path = NULL; char cb_name[1024]; @@ -257,14 +257,14 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) oconfig_item_t *child = ci->children + i; if (! strcasecmp(child->key, "Socket")) - oconfig_get_string(child, &socket); + oconfig_get_string(child, &socket_path); else fprintf(stderr, "MK Livestatus backend: Ignoring unknown config " "option '%s' inside .\n", child->key, name); } - if (! socket) { + if (! socket_path) { fprintf(stderr, "MK Livestatus backend: Instance '%s' missing " "the 'Socket' option.\n", name); return -1; @@ -273,7 +273,7 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) snprintf(cb_name, sizeof(cb_name), "mk-livestatus-%s", name); cb_name[sizeof(cb_name) - 1] = '\0'; - client = sdb_unixsock_client_create(socket); + client = sdb_unixsock_client_create(socket_path); if (! client) { char errbuf[1024]; fprintf(stderr, "MK Livestatus backend: Failed to create unixsock " diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c index 8b7ebd4..ef53a24 100644 --- a/src/daemon/sysdbd.c +++ b/src/daemon/sysdbd.c @@ -157,7 +157,7 @@ int main(int argc, char **argv) { char *config_filename = NULL; - _Bool daemon = 0; + _Bool do_daemonize = 0; struct sigaction sa_intterm; @@ -172,7 +172,7 @@ main(int argc, char **argv) config_filename = optarg; break; case 'd': - daemon = 1; + do_daemonize = 1; break; case 'h': @@ -214,7 +214,7 @@ main(int argc, char **argv) exit(1); } - if (daemon) + if (do_daemonize) if (daemonize()) exit(1);