summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-08-01 13:00:18 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-08-01 13:11:16 -0400
commit3900c702ca59264604a81611779155b874e486c0 (patch)
tree5891410e9b8e3607ca9553b6ddf5ef1f744b2555
parent12cd53117b38f17f4053a728a5de09a447f23e32 (diff)
Check if the PR root directory exists, in `main_loop()`.
-rw-r--r--pullreqd.c7
1 files changed, 7 insertions, 0 deletions
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;