diff options
Diffstat (limited to 'src/pulse/client-conf.c')
-rw-r--r-- | src/pulse/client-conf.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c index c054f663c..75f44182f 100644 --- a/src/pulse/client-conf.c +++ b/src/pulse/client-conf.c @@ -112,13 +112,20 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) { table[6].data = &c->cookie_file; table[7].data = &c->disable_shm; - f = filename ? - fopen((fn = pa_xstrdup(filename)), "r") : - pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn, "r"); + if (filename) { - if (!f && errno != EINTR) { - pa_log_warn("Failed to open configuration file '%s': %s", fn, pa_cstrerror(errno)); - goto finish; + if (!(f = fopen(filename, "r"))) { + pa_log("Failed to open configuration file '%s': %s", fn, pa_cstrerror(errno)); + goto finish; + } + + fn = pa_xstrdup(fn); + + } else { + + if (!(f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn))) + if (errno != ENOENT) + goto finish; } r = f ? pa_config_parse(fn, f, table, NULL) : 0; @@ -126,7 +133,6 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) { if (!r) r = pa_client_conf_load_cookie(c); - finish: pa_xfree(fn); |