From 522ee790ae8a37064bbf830e25bfea8628cae1df Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 25 Sep 2021 15:54:30 -0400 Subject: Add some testing code. --- pullreqd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pullreqd.c') diff --git a/pullreqd.c b/pullreqd.c index 113bb11..33da015 100644 --- a/pullreqd.c +++ b/pullreqd.c @@ -160,6 +160,12 @@ int *init_socket(config *cfg) { int main_loop(config *cfg, int *listen_sockets, git_repo **repos) { int done = 0; struct stat st; + file **patches = (file *[]) { + &(file){"lol.patch", "asfklhasflhk"}, + &(file){"oof.patch", "you just got rekt by some young guy"}, + NULL + }; + pull_request *pr = &(pull_request){"lol", "oof", "some young guy", NULL, time(NULL), 0, {.patches = patches}, NULL}; /* Does the PR root directory exist? */ if (stat(cfg->pr_root, &st) < 0) { @@ -168,6 +174,10 @@ int main_loop(config *cfg, int *listen_sockets, git_repo **repos) { } for (; !done;) { + if (create_pull_request_dir(pr, -1, cfg->pr_root) < 0) { + log(LOG_ERR, "Failed to create Pull Request directory."); + return -1; + } break; } @@ -209,7 +219,7 @@ int main(int argc, char **argv) { int exit_status = EXIT_FAILURE; /* Start it in daemon mode. */ - init_daemon(1, "/"); + /*init_daemon(1, "/");*/ /* Open the logfile. */ openlog("pullreqd", LOG_PID, LOG_DAEMON); -- cgit v1.2.3-13-gbd6f