From: Michael Marineau Date: Fri, 20 Jun 2014 02:07:06 +0000 (-0700) Subject: shared: fix search_and_fopen with alternate roots X-Git-Tag: v215~259 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=375eadd911a9f83f89f1e7de5e05f44cc81e3642 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. --- diff --git a/src/shared/util.c b/src/shared/util.c index c1e1f9f02..aaf109ea6 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;