diff --git a/src/rrd_client.c b/src/rrd_client.c
index 29d1d29989ea3066d201fcbdc037b978637cac47..5481ba3b2622355e728d4f2337ddb2b1648fb380 100644 (file)
--- a/src/rrd_client.c
+++ b/src/rrd_client.c
return 0;
else if (daemon_addr == NULL)
{
+ char *addr = getenv(ENV_RRDCACHED_ADDRESS);
/* here we have to handle the case i.e.
* UPDATE --daemon ...; UPDATEV (no --daemon) ...
* In other words: we have a cached connection,
* but it is not specified in the current command.
* Daemon is only implied in this case if set in ENV
*/
- if (getenv(ENV_RRDCACHED_ADDRESS) != NULL)
+ if (addr != NULL && strcmp(addr,"") != 0)
return 1;
else
return 0;
{
int status = 0;
- if (addr == NULL)
+ if (addr == NULL) {
addr = getenv (ENV_RRDCACHED_ADDRESS);
+ }
- if (addr == NULL)
+ if (addr == NULL || strcmp(addr,"") == 0) {
+ addr = NULL;
return 0;
+ }
pthread_mutex_lock(&lock);