are reachable via many path strings. i.e. when $PWD=/base/dir the
following files are the same:
/base/dir/x.rrd
x.rrd
../dir/x.rrd
* for performance, absolute paths (starting with '/') are not resolved.
this reduces the number of stat(2) system calls.
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1604
a5681a0c-68f1-0310-ab6d-
d61299d08faa
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);