From 2c69eb0aec46e2332fb985f5acf961d2dc0edcd6 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sat, 4 Mar 2017 19:00:26 +0100 Subject: make: splitted reloader --- src/blogc-make/ctx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/blogc-make/ctx.c') 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; } -- cgit v1.2.3-18-g5258