X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_client.c;h=5481ba3b2622355e728d4f2337ddb2b1648fb380;hb=ac7f87b31e9592953cea7a4e05be4413a406b536;hp=29d1d29989ea3066d201fcbdc037b978637cac47;hpb=c597537ef581c7281a0ee75f712778dddd1d6929;p=rrdtool.git diff --git a/src/rrd_client.c b/src/rrd_client.c index 29d1d29..5481ba3 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -485,13 +485,14 @@ int rrdc_is_connected(const char *daemon_addr) /* {{{ */ 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; @@ -652,11 +653,14 @@ int rrdc_connect (const char *addr) /* {{{ */ { 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);