Code

backends, daemon: Don't shadow global 'socket' and 'daemon' symbols.
authorSebastian Harl <sh@tokkee.org>
Mon, 4 Mar 2013 16:27:31 +0000 (17:27 +0100)
committerSebastian Harl <sh@tokkee.org>
Mon, 4 Mar 2013 16:27:31 +0000 (17:27 +0100)
src/backend/collectd.c
src/backend/mk-livestatus.c
src/daemon/sysdbd.c

index f745fc9316d66e9849c219c4ebe2e1d3769a78a9..e0e924e2c959e946f7e645a6879aba0be5ede13c 100644 (file)
@@ -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 <Instance %s>.\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: "
index 57fda523ddf9c81419bb6b565e0d7b305be834fe..a5126fb037e8c3e9a70412b989692b3bdb1e6c3e 100644 (file)
@@ -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 <Instance %s>.\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 "
index 8b7ebd49131262cf8e835a87ab3be9a06b80fba9..ef53a24693a909810108aa113c9c3a8a5843fa08 100644 (file)
@@ -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);