summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 162fd8f)
raw | patch | inline | side by side (parent: 162fd8f)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 28 May 2010 04:55:14 +0000 (04:55 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 28 May 2010 04:55:14 +0000 (04:55 +0000) |
program/src/rrd_client.c | patch | blob | history |
index b895237c52410598f0f03b1b77b8143fa0879663..b3294f4acf88fd6680c5677707cc99721ccd5900 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
|| (strncmp ("unix:", sd_path, strlen ("unix:")) == 0))
is_unix = 1;
- if (*path == '/') /* absolute path */
+ if (is_unix)
{
- if (! is_unix)
- {
- rrd_set_error ("absolute path names not allowed when talking "
- "to a remote daemon");
- return (NULL);
- }
- /* else: nothing to do */
+ ret = realpath(path, resolved_path);
+ if (ret == NULL)
+ rrd_set_error("realpath(%s): %s", path, rrd_strerror(errno));
+ return ret;
}
- else /* relative path */
+ else
{
- if (is_unix)
+ if (*path == '/') /* not absolute path */
{
- realpath (path, resolved_path);
- ret = resolved_path;
+ rrd_set_error ("absolute path names not allowed when talking "
+ "to a remote daemon");
+ return NULL;
}
- /* else: nothing to do */
}
- return (ret);
+
+ return path;
} /* }}} char *get_path */
static size_t strsplit (char *string, char **fields, size_t size) /* {{{ */