From a6f80ad55d419da94c6b3c3766c03e4405fd7f95 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 11 Jan 2008 20:51:22 +0000 Subject: [PATCH] iniparser: return whether file was found --- include/loader.h | 2 +- src/loader.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/loader.h b/include/loader.h index c0e3a52..c4e7760 100644 --- a/include/loader.h +++ b/include/loader.h @@ -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); diff --git a/src/loader.c b/src/loader.c index 46fe278..e57ccab 100644 --- a/src/loader.c +++ b/src/loader.c @@ -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; } -- 2.40.0