src/rrd_{fetch,update}.c: Rename the variable `daemon' to `opt_daemon'.
authorFlorian Forster <octo@leeloo.home.verplant.org>
Tue, 15 Jul 2008 17:30:18 +0000 (19:30 +0200)
committerFlorian Forster <octo@leeloo.home.verplant.org>
Tue, 15 Jul 2008 17:30:18 +0000 (19:30 +0200)
This resolves a stupid warning GCC throws..

src/rrd_fetch.c
src/rrd_update.c

index 956c634..b47a02c 100644 (file)
@@ -73,7 +73,7 @@ int rrd_fetch(
     long      step_tmp = 1;
     time_t    start_tmp = 0, end_tmp = 0;
     const char *cf;
-    char *daemon = NULL;
+    char *opt_daemon = NULL;
     int status;
 
     rrd_time_value_t start_tv, end_tv;
@@ -120,10 +120,10 @@ int rrd_fetch(
             break;
 
         case 'd':
-            if (daemon != NULL)
-                    free (daemon);
-            daemon = strdup (optarg);
-            if (daemon == NULL)
+            if (opt_daemon != NULL)
+                    free (opt_daemon);
+            opt_daemon = strdup (optarg);
+            if (opt_daemon == NULL)
             {
                 rrd_set_error ("strdup failed.");
                 return (-1);
@@ -167,15 +167,15 @@ int rrd_fetch(
         return -1;
     }
 
-    if (daemon == NULL)
+    if (opt_daemon == NULL)
     {
         char *temp;
 
         temp = getenv (ENV_RRDCACHED_ADDRESS);
         if (temp != NULL)
         {
-            daemon = strdup (temp);
-            if (daemon == NULL)
+            opt_daemon = strdup (temp);
+            if (opt_daemon == NULL)
             {
                 rrd_set_error("strdup failed.");
                 return (-1);
@@ -183,9 +183,9 @@ int rrd_fetch(
         }
     }
 
-    if (daemon != NULL)
+    if (opt_daemon != NULL)
     {
-        status = rrdc_connect (daemon);
+        status = rrdc_connect (opt_daemon);
         if (status != 0)
         {
             rrd_set_error ("rrdc_connect failed with status %i.", status);
@@ -201,7 +201,7 @@ int rrd_fetch(
         }
 
         rrdc_disconnect ();
-    } /* if (daemon) */
+    } /* if (opt_daemon) */
 
     cf = argv[optind + 1];
 
index ffbcebb..ed4b48e 100644 (file)
@@ -384,7 +384,7 @@ int rrd_update(
     int       opt;
     char     *tmplt = NULL;
     int       rc = -1;
-    char     *daemon = NULL;
+    char     *opt_daemon = NULL;
 
     optind = 0;
     opterr = 0;         /* initialize getopt */
@@ -401,10 +401,10 @@ int rrd_update(
             break;
 
         case 'd':
-            if (daemon != NULL)
-                free (daemon);
-            daemon = strdup (optarg);
-            if (daemon == NULL)
+            if (opt_daemon != NULL)
+                free (opt_daemon);
+            opt_daemon = strdup (optarg);
+            if (opt_daemon == NULL)
             {
                 rrd_set_error("strdup failed.");
                 goto out;
@@ -423,22 +423,22 @@ int rrd_update(
         goto out;
     }
 
-    if ((tmplt != NULL) && (daemon != NULL))
+    if ((tmplt != NULL) && (opt_daemon != NULL))
     {
-        rrd_set_error("The caching daemon cannot be used together with "
+        rrd_set_error("The caching opt_daemon cannot be used together with "
                 "templates yet.");
         goto out;
     }
 
-    if ((tmplt == NULL) && (daemon == NULL))
+    if ((tmplt == NULL) && (opt_daemon == NULL))
     {
         char *temp;
 
         temp = getenv (ENV_RRDCACHED_ADDRESS);
         if (temp != NULL)
         {
-            daemon = strdup (temp);
-            if (daemon == NULL)
+            opt_daemon = strdup (temp);
+            if (opt_daemon == NULL)
             {
                 rrd_set_error("strdup failed.");
                 goto out;
@@ -446,14 +446,14 @@ int rrd_update(
         }
     }
 
-    if (daemon != NULL)
+    if (opt_daemon != NULL)
     {
         int status;
 
-        status = rrdc_connect (daemon);
+        status = rrdc_connect (opt_daemon);
         if (status != 0)
         {
-            rrd_set_error("Unable to connect to daemon: %s",
+            rrd_set_error("Unable to connect to opt_daemon: %s",
                     (status < 0)
                     ? "Internal error"
                     : rrd_strerror (status));
@@ -465,7 +465,7 @@ int rrd_update(
                 /* values = */ (void *) (argv + optind + 1));
         if (status != 0)
         {
-            rrd_set_error("Failed sending the values to the daemon: %s",
+            rrd_set_error("Failed sending the values to the opt_daemon: %s",
                     (status < 0)
                     ? "Internal error"
                     : rrd_strerror (status));
@@ -477,7 +477,7 @@ int rrd_update(
 
         rrdc_disconnect ();
         goto out;
-    } /* if (daemon != NULL) */
+    } /* if (opt_daemon != NULL) */
 
     rc = rrd_update_r(argv[optind], tmplt,
                       argc - optind - 1, (const char **) (argv + optind + 1));
@@ -487,10 +487,10 @@ int rrd_update(
         free(tmplt);
         tmplt = NULL;
     }
-    if (daemon != NULL)
+    if (opt_daemon != NULL)
     {
-        free (daemon);
-        daemon = NULL;
+        free (opt_daemon);
+        opt_daemon = NULL;
     }
     return rc;
 }