}
opt_daemon = getenv (ENV_RRDCACHED_ADDRESS);
- if (opt_daemon != NULL) {
+ if (opt_daemon != NULL && ! strcmp(opt_daemon,"")) {
rrd_set_error ("The \"%s\" environment variable is defined, "
"but \"%s\" cannot work with rrdcached. Either unset "
"the environment variable or use \"update\" instead.",
ENV_RRDCACHED_ADDRESS, argv[0]);
goto end_tag;
}
-
+
/* need at least 2 arguments: filename, data. */
if (argc - optind < 2) {
rrd_set_error("Not enough arguments");
{ /* try to connect to rrdcached */
int status = rrdc_connect(opt_daemon);
- if (status != 0) return status;
+ if (status != 0) {
+ rc = status;
+ goto out;
+ }
}
if ((tmplt != NULL) && rrdc_is_connected(opt_daemon))
*current_time = tmp_time.tv_sec;
*current_time_usec = tmp_time.tv_usec;
} else {
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
tmp = strtod(updvals[0], 0);
if (errno > 0) {
}
break;
case DST_ABSOLUTE:
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
pdp_new[ds_idx] = strtod(updvals[ds_idx + 1], &endptr);
if (errno > 0) {
rate = pdp_new[ds_idx] / interval;
break;
case DST_GAUGE:
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
pdp_new[ds_idx] =
strtod(updvals[ds_idx + 1], &endptr) * interval;