From 3348b3f64d933a8bdaf0f076646cc0073f161db1 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 9 Jun 2021 21:59:53 -0400 Subject: Moved the main loop into a separate function. --- pullreqd.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pullreqd.c b/pullreqd.c index 1e9f8e1..635a69c 100644 --- a/pullreqd.c +++ b/pullreqd.c @@ -79,6 +79,14 @@ int init_config(char *config_file, config **cfg) { return (*cfg != NULL); } +int main_loop(config *cfg, int listen_socket) { + int done = 0; + + for (; !done;) { + break; + } +} + int main(int argc, char **argv) { config *cfg; char *config_file = "test.conf"; @@ -93,13 +101,7 @@ int main(int argc, char **argv) { /* Did we successfully read the config file? */ if (config_read) { - int done = 0; - - for (; !done;) { - break; - } - - exit_status = EXIT_SUCCESS; + exit_status = main_loop(cfg, listen_socket); } syslog(LOG_NOTICE, "pullreqd stopped."); -- cgit v1.2.3-13-gbd6f