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 (parent:
c800e48
)
path-lookup: add both the configured and the fixed search paths in
author
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Jul 2011 02:19:29 +0000
(
04:19
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Jul 2011 02:31:20 +0000
(
04:31
+0200)
src/path-lookup.c
patch
|
blob
|
history
diff --git
a/src/path-lookup.c
b/src/path-lookup.c
index 84a9859254eebcd263072b7efe193fd92cc4ce94..e1925f1a4d54e4fb5ca328c6bf7e1cbd5170f77a 100644
(file)
--- a/
src/path-lookup.c
+++ b/
src/path-lookup.c
@@
-53,6
+53,20
@@
int user_config_home(char **config_home) {
}
static char** user_dirs(void) {
}
static char** user_dirs(void) {
+ const char * const config_unit_paths[] = {
+ "/run/systemd/user",
+ USER_CONFIG_UNIT_PATH,
+ "/etc/systemd/user"
+ };
+
+ const char * const data_unit_paths[] = {
+ "/usr/local/lib/systemd/user",
+ "/usr/local/share/systemd/user",
+ USER_DATA_UNIT_PATH,
+ "/usr/lib/systemd/user",
+ "/usr/share/systemd/user"
+ };
+
const char *home, *e;
char *config_home = NULL, *data_home = NULL;
char **config_dirs = NULL, **data_dirs = NULL;
const char *home, *e;
char *config_home = NULL, *data_home = NULL;
char **config_dirs = NULL, **data_dirs = NULL;
@@
-103,9
+117,7
@@
static char** user_dirs(void) {
data_dirs = strv_split(e, ":");
else
data_dirs = strv_new("/usr/local/share",
data_dirs = strv_split(e, ":");
else
data_dirs = strv_new("/usr/local/share",
- "/usr/local/lib",
"/usr/share",
"/usr/share",
- "/usr/lib",
NULL);
if (!data_dirs)
NULL);
if (!data_dirs)
@@
-119,12
+131,14
@@
static char** user_dirs(void) {
r = t;
}
r = t;
}
- if (!(t = strv_merge_concat(r, config_dirs, "/systemd/user")))
- goto finish;
- strv_free(r);
- r = t;
+ if (!strv_isempty(config_dirs)) {
+ if (!(t = strv_merge_concat(r, config_dirs, "/systemd/user")))
+ goto finish;
+ strv_free(r);
+ r = t;
+ }
- if (!(t = strv_
append(r, USER_CONFIG_UNIT_PATH
)))
+ if (!(t = strv_
merge(r, (char**) config_unit_paths
)))
goto fail;
strv_free(r);
r = t;
goto fail;
strv_free(r);
r = t;
@@
-136,12
+150,14
@@
static char** user_dirs(void) {
r = t;
}
r = t;
}
- if (!(t = strv_merge_concat(r, data_dirs, "/systemd/user")))
- goto fail;
- strv_free(r);
- r = t;
+ if (!strv_isempty(data_dirs)) {
+ if (!(t = strv_merge_concat(r, data_dirs, "/systemd/user")))
+ goto fail;
+ strv_free(r);
+ r = t;
+ }
- if (!(t = strv_
append(r, USER_DATA_UNIT_PATH
)))
+ if (!(t = strv_
merge(r, (char**) data_unit_paths
)))
goto fail;
strv_free(r);
r = t;
goto fail;
strv_free(r);
r = t;