[pulseaudio-discuss] [PATCH] conf-parser: add support for .d directories
Tanu Kaskinen
tanuk at iki.fi
Wed May 27 02:32:19 PDT 2015
On Wed, 2015-05-27 at 00:13 +0200, Peter Meerwald wrote:
> > @@ -163,6 +169,38 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
> >
> > pa_zero(state);
> >
> > + if (use_dot_d) {
> > + char *dir_name;
> > + int n;
> > + struct dirent **entries = NULL;
> > +
> > + dir_name = pa_sprintf_malloc("%s.d", filename);
> > +
> > + n = scandir(dir_name, &entries, conf_filter, alphasort);
> > + if (n >= 0) {
> > + int i;
> > +
> > + for (i = 0; i < n; i++) {
> > + char *filename2;
> > +
> > + filename2 = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", dir_name, entries[i]->d_name);
> > + pa_config_parse(filename2, NULL, t, proplist, false, userdata);
>
> the return value is not checked;
> for config files included with .include, the retval is checked
In my opinion pa_config_parse() shouldn't even return anything. A single
fault in the client.conf shouldn't prevent all clients from connecting
to the server, and reverting to the default configuration isn't a good
option either. A single configuration fault should only result in a
single error message in the log, and the configuration parsing should
continue as usual after the error.
So, I think when config files are included with .include, the return
value of pa_config_parse() should not be checked.
--
Tanu
More information about the pulseaudio-discuss
mailing list