summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-09 21:56:05 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-09 21:56:05 -0400
commitd23940bb9d366037564c2cce3e68adf9c3379182 (patch)
tree22753b5d28e17631fbf426626820d7179f4581d9 /pullreqd.c
parent7d8c2263eb728c343853fc846a85586b16550cb7 (diff)
Move the main loop code into an if statement.
This was done to make it easier to understand what's going on.
Diffstat (limited to 'pullreqd.c')
-rw-r--r--pullreqd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/pullreqd.c b/pullreqd.c
index 26c14e8..1e9f8e1 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -82,19 +82,24 @@ int init_config(char *config_file, config **cfg) {
int main(int argc, char **argv) {
config *cfg;
char *config_file = "test.conf";
- int done = 0;
int config_read = 0;
+ int exit_status = EXIT_FAILURE;
init_daemon(1, "/");
syslog(LOG_NOTICE, "pullreqd started.");
/* Read the config file. */
config_read = init_config(config_file, &cfg);
- /* Immediatly exit, if we failed to read the config file. */
- done = !config_read;
- for (; !done;) {
- break;
+ /* Did we successfully read the config file? */
+ if (config_read) {
+ int done = 0;
+
+ for (; !done;) {
+ break;
+ }
+
+ exit_status = EXIT_SUCCESS;
}
syslog(LOG_NOTICE, "pullreqd stopped.");