summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorMichael Marineau <michael.marineau@coreos.com>2014-06-19 19:07:06 -0700
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-06-20 00:10:47 -0400
commit375eadd911a9f83f89f1e7de5e05f44cc81e3642 (patch)
tree235477e85c4932b67455b8263df75430d581a251 /src/shared
parent09e00c524fd4d21a3508c27d01d265b8a6c9ae30 (diff)
shared: fix search_and_fopen with alternate roots
Update for the current behavior of path_strv_resolve which now returns paths relative to the given root, not the full absolute paths.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index c1e1f9f020..aaf109ea63 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5686,7 +5686,10 @@ static int search_and_fopen_internal(const char *path, const char *mode, const c
_cleanup_free_ char *p = NULL;
FILE *f;
- p = strjoin(*i, "/", path, NULL);
+ if (root)
+ p = strjoin(root, *i, "/", path, NULL);
+ else
+ p = strjoin(*i, "/", path, NULL);
if (!p)
return -ENOMEM;