mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
conf: PIPEWIRE_CONFIG_DIR should take precedence if set
This matches the behavior of most applications - check environment variables first, then fall back to the various built-in options (in our case xdg, /etc/ /usr/share, in that order).
This commit is contained in:
parent
25a58fd939
commit
5e5b9e3050
1 changed files with 10 additions and 3 deletions
|
|
@ -77,6 +77,14 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dir = getenv("PIPEWIRE_CONFIG_DIR");
|
||||||
|
if (dir != NULL) {
|
||||||
|
const char *paths[] = { dir, prefix, name, NULL };
|
||||||
|
if (make_path(path, size, paths) == 0 &&
|
||||||
|
access(path, R_OK) == 0)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
dir = getenv("XDG_CONFIG_HOME");
|
dir = getenv("XDG_CONFIG_HOME");
|
||||||
if (dir != NULL) {
|
if (dir != NULL) {
|
||||||
const char *paths[] = { dir, "pipewire", prefix, name, NULL };
|
const char *paths[] = { dir, "pipewire", prefix, name, NULL };
|
||||||
|
|
@ -96,9 +104,8 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char
|
||||||
access(path, R_OK) == 0)
|
access(path, R_OK) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
dir = getenv("PIPEWIRE_CONFIG_DIR");
|
|
||||||
if (dir == NULL)
|
dir = PIPEWIRE_CONFIG_DIR;
|
||||||
dir = PIPEWIRE_CONFIG_DIR;
|
|
||||||
if (dir != NULL) {
|
if (dir != NULL) {
|
||||||
const char *paths[] = { dir, prefix, name, NULL };
|
const char *paths[] = { dir, prefix, name, NULL };
|
||||||
if (make_path(path, size, paths) == 0 &&
|
if (make_path(path, size, paths) == 0 &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue