From bf6b94116fd0f55df94a846a69778f948182edbb Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 8 Jun 2021 19:43:10 -0400 Subject: Added the `done` flag. This flag, when true, exits the main loop, and thus exits the program. --- pullreqd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pullreqd.c b/pullreqd.c index 039b8bc..406af10 100644 --- a/pullreqd.c +++ b/pullreqd.c @@ -64,9 +64,10 @@ void init_daemon(int change_dir, char *path) { } int main(int argc, char **argv) { + int done = 0; init_daemon(1, "/"); syslog(LOG_NOTICE, "pullreqd started."); - for (;;) { + for (; !done;) { break; } syslog(LOG_NOTICE, "pullreqd stopped."); -- cgit v1.2.3-13-gbd6f