src/rrd_{fetch,graph,update}.c: Use the `RRDCACHED_ADDRESS' environment variable..
[rrdtool.git] / src / rrd_update.c
index 2602a82..da68270 100644 (file)
@@ -430,6 +430,22 @@ int rrd_update(
         goto out;
     }
 
+    if ((tmplt == NULL) && (daemon == NULL))
+    {
+        char *temp;
+
+        temp = getenv (ENV_RRDCACHED_ADDRESS);
+        if (temp != NULL)
+        {
+            daemon = strdup (temp);
+            if (daemon == NULL)
+            {
+                rrd_set_error("strdup failed.");
+                goto out;
+            }
+        }
+    }
+
     if (daemon != NULL)
     {
         int status;