chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shared: conf-files - add root parameter
[elogind.git]
/
src
/
shared
/
conf-files.c
diff --git
a/src/shared/conf-files.c
b/src/shared/conf-files.c
index 34b86293d3a246b9703a36eab41f8f020de4ff38..368b7bf6bb3b319d60b88ed24ba92962f01c4377 100644
(file)
--- a/
src/shared/conf-files.c
+++ b/
src/shared/conf-files.c
@@
-37,7
+37,7
@@
#include "hashmap.h"
#include "conf-files.h"
#include "hashmap.h"
#include "conf-files.h"
-static int files_add(Hashmap *h, const char *path, const char *suffix) {
+static int files_add(Hashmap *h, const char *
root, const char *
path, const char *suffix) {
DIR *dir;
int r = 0;
DIR *dir;
int r = 0;
@@
-90,7
+90,7
@@
static int base_cmp(const void *a, const void *b) {
return strcmp(path_get_file_name(s1), path_get_file_name(s2));
}
return strcmp(path_get_file_name(s1), path_get_file_name(s2));
}
-int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
+int conf_files_list_strv(char ***strv, const char *suffix, const char *
root, const char *
*dirs) {
Hashmap *fh = NULL;
char **files = NULL;
const char **p;
Hashmap *fh = NULL;
char **files = NULL;
const char **p;
@@
-105,7
+105,7
@@
int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
}
STRV_FOREACH(p, dirs) {
}
STRV_FOREACH(p, dirs) {
- r = files_add(fh, *p, suffix);
+ r = files_add(fh,
root,
*p, suffix);
if (r < 0)
log_warning("Failed to search for files in %s: %s",
*p, strerror(-r));
if (r < 0)
log_warning("Failed to search for files in %s: %s",
*p, strerror(-r));
@@
-126,7
+126,7
@@
finish:
return r;
}
return r;
}
-int conf_files_list(char ***strv, const char *suffix, const char *dir, ...) {
+int conf_files_list(char ***strv, const char *suffix, const char *
root, const char *
dir, ...) {
char **dirs = NULL;
va_list ap;
int r;
char **dirs = NULL;
va_list ap;
int r;
@@
-145,7
+145,7
@@
int conf_files_list(char ***strv, const char *suffix, const char *dir, ...) {
}
strv_uniq(dirs);
}
strv_uniq(dirs);
- r = conf_files_list_strv(strv, suffix, (const char **)dirs);
+ r = conf_files_list_strv(strv, suffix,
root,
(const char **)dirs);
finish:
strv_free(dirs);
finish:
strv_free(dirs);