chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
09e00c5
)
shared: fix search_and_fopen with alternate roots
author
Michael Marineau
<michael.marineau@coreos.com>
Fri, 20 Jun 2014 02:07:06 +0000
(19:07 -0700)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 20 Jun 2014 04:10:47 +0000
(
00:10
-0400)
Update for the current behavior of path_strv_resolve which now returns
paths relative to the given root, not the full absolute paths.
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index c1e1f9f020f6eb9287c6c46ee4c2f72e4aa1f785..aaf109ea63e6f89d7c7edc8bfd7aea5f88d9034b 100644
(file)
--- 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;