aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/ctx.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-04 19:00:26 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-04 19:00:26 +0100
commit2c69eb0aec46e2332fb985f5acf961d2dc0edcd6 (patch)
tree141514e6efc8ad148e098be48d3fd40b8761ff71 /src/blogc-make/ctx.c
parent9ba9a5919f6f87700d14a9125359b2bca0d86f58 (diff)
downloadblogc-2c69eb0aec46e2332fb985f5acf961d2dc0edcd6.tar.gz
blogc-2c69eb0aec46e2332fb985f5acf961d2dc0edcd6.tar.bz2
blogc-2c69eb0aec46e2332fb985f5acf961d2dc0edcd6.zip
make: splitted reloader
Diffstat (limited to 'src/blogc-make/ctx.c')
-rw-r--r--src/blogc-make/ctx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c
index 62b40b8..ff825e1 100644
--- a/src/blogc-make/ctx.c
+++ b/src/blogc-make/ctx.c
@@ -215,11 +215,11 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0,
}
-void
+bool
bm_ctx_reload(bm_ctx_t *ctx)
{
if (ctx == NULL || ctx->settings_fctx == NULL)
- return;
+ return false;
if (bm_filectx_changed(ctx->settings_fctx, NULL)) {
// reload everything! we could just reload settings_fctx, as this
@@ -231,11 +231,12 @@ bm_ctx_reload(bm_ctx_t *ctx)
bc_error_t *err = NULL;
ctx = bm_ctx_new(ctx, tmp, NULL, &err);
free(tmp);
- if (err != NULL) { // failed to reload, keep old ctx
+ if (err != NULL) {
bc_error_print(err, "blogc-make");
bc_error_free(err);
+ return false;
}
- return;
+ return true;
}
bm_filectx_reload(ctx->main_template_fctx);
@@ -249,6 +250,8 @@ bm_ctx_reload(bm_ctx_t *ctx)
for (bc_slist_t *tmp = ctx->copy_fctx; tmp != NULL; tmp = tmp->next)
bm_filectx_reload((bm_filectx_t*) tmp->data);
+
+ return true;
}