mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
some commenting
change alogrithm for checking for configuration files git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@273 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2aad9e3ae2
commit
5844a33f0b
9 changed files with 156 additions and 84 deletions
|
|
@ -89,13 +89,13 @@ static int parse_line(const char *filename, unsigned line, const struct pa_confi
|
|||
}
|
||||
|
||||
|
||||
int pa_config_parse(const char *filename, const struct pa_config_item *t, void *userdata) {
|
||||
FILE *f;
|
||||
int pa_config_parse(const char *filename, FILE *f, const struct pa_config_item *t, void *userdata) {
|
||||
int r = -1;
|
||||
unsigned line = 0;
|
||||
int do_close = !f;
|
||||
assert(filename && t);
|
||||
|
||||
if (!(f = fopen(filename, "r"))) {
|
||||
if (!f && !(f = fopen(filename, "r"))) {
|
||||
if (errno == ENOENT) {
|
||||
r = 0;
|
||||
goto finish;
|
||||
|
|
@ -123,7 +123,7 @@ int pa_config_parse(const char *filename, const struct pa_config_item *t, void *
|
|||
|
||||
finish:
|
||||
|
||||
if (f)
|
||||
if (do_close && f)
|
||||
fclose(f);
|
||||
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue