diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 13:00:18 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 13:11:16 -0400 |
commit | 3900c702ca59264604a81611779155b874e486c0 (patch) | |
tree | 5891410e9b8e3607ca9553b6ddf5ef1f744b2555 | |
parent | 12cd53117b38f17f4053a728a5de09a447f23e32 (diff) |
Check if the PR root directory exists, in `main_loop()`.
-rw-r--r-- | pullreqd.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |