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:
Lennart Poettering 2004-11-04 21:27:12 +00:00
parent 2aad9e3ae2
commit 5844a33f0b
9 changed files with 156 additions and 84 deletions

View file

@ -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;