mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-16 08:56:40 -05:00
daemon: fix default daemon.conf when running from build tree
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/446>
This commit is contained in:
parent
6bfd9c809e
commit
f18f55bb5e
1 changed files with 13 additions and 1 deletions
|
|
@ -665,9 +665,21 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
|
||||||
pa_xfree(c->config_file);
|
pa_xfree(c->config_file);
|
||||||
c->config_file = NULL;
|
c->config_file = NULL;
|
||||||
|
|
||||||
|
const char *default_config_file = DEFAULT_CONFIG_FILE;
|
||||||
|
#ifdef HAVE_RUNNING_FROM_BUILD_TREE
|
||||||
|
if (pa_run_from_build_tree()) {
|
||||||
|
pa_log_notice("Detected that we are run from the build tree, fixing default daemon.conf file path.");
|
||||||
|
#ifdef MESON_BUILD
|
||||||
|
default_config_file = PA_BUILDDIR PA_PATH_SEP "src" PA_PATH_SEP "daemon" PA_PATH_SEP "daemon.conf";
|
||||||
|
#else
|
||||||
|
default_config_file = PA_BUILDDIR PA_PATH_SEP "daemon.conf";
|
||||||
|
#endif // Endof #ifdef MESON_BUILD
|
||||||
|
}
|
||||||
|
#endif // Endof #ifdef HAVE_RUNNING_FROM_BUILD_TREE
|
||||||
|
|
||||||
f = filename ?
|
f = filename ?
|
||||||
pa_fopen_cloexec(c->config_file = pa_xstrdup(filename), "r") :
|
pa_fopen_cloexec(c->config_file = pa_xstrdup(filename), "r") :
|
||||||
pa_open_config_file(DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_FILE_USER, ENV_CONFIG_FILE, &c->config_file);
|
pa_open_config_file(default_config_file, DEFAULT_CONFIG_FILE_USER, ENV_CONFIG_FILE, &c->config_file);
|
||||||
|
|
||||||
if (!f && errno != ENOENT) {
|
if (!f && errno != ENOENT) {
|
||||||
pa_log_warn(_("Failed to open configuration file: %s"), pa_cstrerror(errno));
|
pa_log_warn(_("Failed to open configuration file: %s"), pa_cstrerror(errno));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue