From 3900c702ca59264604a81611779155b874e486c0 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 1 Aug 2021 13:00:18 -0400 Subject: Check if the PR root directory exists, in `main_loop()`. --- pullreqd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pullreqd.c b/pullreqd.c index ae98078..00d72e9 100644 --- a/pullreqd.c +++ b/pullreqd.c @@ -162,6 +162,13 @@ int init_socket(config *cfg) { int main_loop(config *cfg, int listen_socket, git_repository **repos) { int done = 0; + struct stat st; + + /* Does the PR root directory exist? */ + if (stat(cfg->pr_root, &st) < 0) { + /* Create the PR root directory. */ + mkdir(cfg->pr_root, 0755); + } for (; !done;) { break; -- cgit v1.2.3-13-gbd6f