]> granicus.if.org Git - pgbouncer/commitdiff
iniparser: return whether file was found
authorMarko Kreen <markokr@gmail.com>
Fri, 11 Jan 2008 20:51:22 +0000 (20:51 +0000)
committerMarko Kreen <markokr@gmail.com>
Fri, 11 Jan 2008 20:51:22 +0000 (20:51 +0000)
include/loader.h
src/loader.c

index c0e3a5230a9f19d61aa5997e22bae6b846f4741c..c4e7760b5b54e8c67930476b85060ec636f3f5f0 100644 (file)
@@ -51,7 +51,7 @@ typedef struct ConfSection {
        conf_data_callback_fn data_fn;
 } ConfSection;
 
-void iniparser(const char *fn, ConfSection *sect_list, bool reload);
+bool iniparser(const char *fn, ConfSection *sect_list, bool reload)  _MUSTCHECK;
 
 const char * cf_get_int(ConfElem *elem);
 bool cf_set_int(ConfElem *elem, const char *value, PgSocket *console);
index 46fe278fe0d3821e2b174421ab287f2c6f665378..e57ccab759984a05087369a6fb66d2022fa66f45 100644 (file)
@@ -579,7 +579,7 @@ static ConfSection *find_section(ConfSection *sect, const char *name)
        return NULL;
 }
 
-void iniparser(const char *fn, ConfSection *sect_list, bool reload)
+bool iniparser(const char *fn, ConfSection *sect_list, bool reload)
 {
        char *buf;
        char *p, *key, *val;
@@ -591,7 +591,7 @@ void iniparser(const char *fn, ConfSection *sect_list, bool reload)
                if (!reload)
                        exit(1);
                else
-                       return;
+                       return false;
        }
 
        p = buf;
@@ -655,5 +655,6 @@ void iniparser(const char *fn, ConfSection *sect_list, bool reload)
        }
 
        free(buf);
+       return true;
 }