summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pullreqd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pullreqd.c b/pullreqd.c
index 406af10..2df8809 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -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, "/");