diff options
Diffstat (limited to 'pullreqd.c')
-rw-r--r-- | pullreqd.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -63,6 +63,21 @@ void init_daemon(int change_dir, char *path) { openlog("pullreqd", LOG_PID, LOG_DAEMON); } +int init_config(char *config_file, config **cfg) { + syslog(LOG_INFO, "Reading config file %s.", config_file); + + *cfg = parse_config(config_file); + + /* Did the config file parser succeed? */ + if (*cfg != NULL) { + syslog(LOG_INFO, "Successfully read %s.", config_file); + } else { + syslog(LOG_ERROR, "Error reading %s.", config_file); + } + + return (*cfg != NULL); +} + int main(int argc, char **argv) { int done = 0; init_daemon(1, "/"); |