summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c12
-rw-r--r--src/shared/util.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 9e8cd54d04..8b8d2fbc5e 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5668,14 +5668,14 @@ int on_ac_power(void) {
return found_online || !found_offline;
}
-static int search_and_fopen_internal(const char *path, const char *mode, char **search, FILE **_f) {
+static int search_and_fopen_internal(const char *path, const char *mode, const char *root, char **search, FILE **_f) {
char **i;
assert(path);
assert(mode);
assert(_f);
- if (!path_strv_canonicalize_absolute_uniq(search, NULL))
+ if (!path_strv_canonicalize_absolute_uniq(search, root))
return -ENOMEM;
STRV_FOREACH(i, search) {
@@ -5699,7 +5699,7 @@ static int search_and_fopen_internal(const char *path, const char *mode, char **
return -ENOENT;
}
-int search_and_fopen(const char *path, const char *mode, const char **search, FILE **_f) {
+int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f) {
_cleanup_strv_free_ char **copy = NULL;
assert(path);
@@ -5722,10 +5722,10 @@ int search_and_fopen(const char *path, const char *mode, const char **search, FI
if (!copy)
return -ENOMEM;
- return search_and_fopen_internal(path, mode, copy, _f);
+ return search_and_fopen_internal(path, mode, root, copy, _f);
}
-int search_and_fopen_nulstr(const char *path, const char *mode, const char *search, FILE **_f) {
+int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f) {
_cleanup_strv_free_ char **s = NULL;
if (path_is_absolute(path)) {
@@ -5744,7 +5744,7 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *sear
if (!s)
return -ENOMEM;
- return search_and_fopen_internal(path, mode, s, _f);
+ return search_and_fopen_internal(path, mode, root, s, _f);
}
char *strextend(char **x, ...) {
diff --git a/src/shared/util.h b/src/shared/util.h
index 81831e2771..e99f8d1123 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -696,8 +696,8 @@ char *strip_tab_ansi(char **p, size_t *l);
int on_ac_power(void);
-int search_and_fopen(const char *path, const char *mode, const char **search, FILE **_f);
-int search_and_fopen_nulstr(const char *path, const char *mode, const char *search, FILE **_f);
+int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
+int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f);
#define FOREACH_LINE(line, f, on_error) \
for (;;) \