summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91fd5f7)
raw | patch | inline | side by side (parent: 91fd5f7)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 14 Oct 2008 19:08:56 +0000 (19:08 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 14 Oct 2008 19:08:56 +0000 (19:08 +0000) |
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
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
src/rrd_client.c | patch | blob | history |
diff --git a/src/rrd_client.c b/src/rrd_client.c
index 76fded03830fee7346f9ee98258bff027661b29d..5583bfeb59fe5e159b787f2cdb087feb7303a019 100644 (file)
--- a/src/rrd_client.c
+++ b/src/rrd_client.c
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);