X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_client.c;fp=src%2Frrd_client.c;h=e3790f6b24e2ab8177337cd00a998f16fd5708e2;hp=29d1d29989ea3066d201fcbdc037b978637cac47;hb=13d7a72e157462f61aa90d3352479c0b4180e069;hpb=bb288b1f7ffdb886160ca7b4f332db42b1c7578e diff --git a/src/rrd_client.c b/src/rrd_client.c index 29d1d29..e3790f6 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,"")) return 1; else return 0; @@ -655,7 +656,8 @@ int rrdc_connect (const char *addr) /* {{{ */ if (addr == NULL) addr = getenv (ENV_RRDCACHED_ADDRESS); - if (addr == NULL) + if (addr == NULL || ! strcmp(addr,"")) + addr = NULL; return 0; pthread_mutex_lock(&lock);