rrdc_response_t *res;
int status;
int i;
+ char file_path[PATH_MAX];
memset (buffer, 0, sizeof (buffer));
buffer_ptr = &buffer[0];
if (status != 0)
return (ENOBUFS);
+ /* change to absolute path for rrdcached */
+ if (*filename != '/' && realpath(filename, file_path) != NULL)
+ filename = file_path;
+
status = buffer_add_string (filename, &buffer_ptr, &buffer_free);
if (status != 0)
return (ENOBUFS);
size_t buffer_size;
rrdc_response_t *res;
int status;
+ char file_path[PATH_MAX];
if (filename == NULL)
return (-1);
if (status != 0)
return (ENOBUFS);
+ /* change to absolute path for rrdcached */
+ if (*filename != '/' && realpath(filename, file_path) != NULL)
+ filename = file_path;
+
status = buffer_add_string (filename, &buffer_ptr, &buffer_free);
if (status != 0)
return (ENOBUFS);
if (rrdc_is_connected(opt_daemon))
{
+ rrd_clear_error();
status = rrdc_flush (filename);
- if (status != 0)
+
+ if (status != 0 && !rrd_test_error())
{
- rrd_set_error ("rrdc_flush (%s) failed with status %i.",
- filename, status);
+ if (status > 0)
+ {
+ rrd_set_error("rrdc_flush (%s) failed: %s",
+ filename, rrd_strerror(status));
+ }
+ else if (status < 0)
+ {
+ rrd_set_error("rrdc_flush (%s) failed with status %i.",
+ filename, status);
+ }
}
} /* if (rrdc_is_connected(..)) */
if (this->name != NULL)
{
- free (this->name);
+ free ((char *)this->name);
this->name = NULL;
}
free (this);