[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] daemon: fix default daemon.conf when running from build tree
PulseAudio Marge Bot
gitlab at gitlab.freedesktop.org
Mon Jan 4 16:16:26 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
f18f55bb by Igor V. Kovalenko at 2021-01-04T16:11:04+00:00
daemon: fix default daemon.conf when running from build tree
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/446>
- - - - -
1 changed file:
- src/daemon/daemon-conf.c
Changes:
=====================================
src/daemon/daemon-conf.c
=====================================
@@ -665,9 +665,21 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
pa_xfree(c->config_file);
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 ?
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) {
pa_log_warn(_("Failed to open configuration file: %s"), pa_cstrerror(errno));
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/f18f55bb5ee4391370e59528ff0aa93068299252
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/f18f55bb5ee4391370e59528ff0aa93068299252
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210104/21331c43/attachment.htm>
More information about the pulseaudio-commits
mailing list