diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-13 23:44:17 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-13 23:44:17 +0100 |
commit | 6dc12e00c852b143429b3db0c01cb9abcf102b8f (patch) | |
tree | cdb22574107bda34431f3572607505573a20f1df | |
parent | bddf3b851e19b448d0bafb7a3b43d320731ce296 (diff) | |
download | blogc-6dc12e00c852b143429b3db0c01cb9abcf102b8f.tar.gz blogc-6dc12e00c852b143429b3db0c01cb9abcf102b8f.tar.bz2 blogc-6dc12e00c852b143429b3db0c01cb9abcf102b8f.zip |
Revert "make: fixed context reloading"
This reverts commit 89e2a39d1ee66a233b1cd21606ba66b32b902b08.
This commit was reverted only to test the clang-analyzer travis job.
-rw-r--r-- | src/blogc-make/ctx.c | 20 | ||||
-rw-r--r-- | src/blogc-make/ctx.h | 2 | ||||
-rw-r--r-- | src/blogc-make/reloader.c | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c index 0a3f9a0..8e152da 100644 --- a/src/blogc-make/ctx.c +++ b/src/blogc-make/ctx.c @@ -270,20 +270,20 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0, bool -bm_ctx_reload(bm_ctx_t **ctx) +bm_ctx_reload(bm_ctx_t *ctx) { - if (*ctx == NULL || (*ctx)->settings_fctx == NULL) + if (ctx == NULL || ctx->settings_fctx == NULL) return false; - if (bm_filectx_changed((*ctx)->settings_fctx, NULL, NULL)) { + if (bm_filectx_changed(ctx->settings_fctx, NULL, NULL)) { // reload everything! we could just reload settings_fctx, as this // would force rebuilding everything, but we need to know new/deleted // files // needs to dup path, because it may be freed when reloading. - char *tmp = bc_strdup((*ctx)->settings_fctx->path); + char *tmp = bc_strdup(ctx->settings_fctx->path); bc_error_t *err = NULL; - *ctx = bm_ctx_new(*ctx, tmp, NULL, &err); + ctx = bm_ctx_new(ctx, tmp, NULL, &err); free(tmp); if (err != NULL) { bc_error_print(err, "blogc-make"); @@ -293,16 +293,16 @@ bm_ctx_reload(bm_ctx_t **ctx) return true; } - bm_filectx_reload((*ctx)->main_template_fctx); - bm_filectx_reload((*ctx)->atom_template_fctx); + bm_filectx_reload(ctx->main_template_fctx); + bm_filectx_reload(ctx->atom_template_fctx); - for (bc_slist_t *tmp = (*ctx)->posts_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = ctx->posts_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); - for (bc_slist_t *tmp = (*ctx)->pages_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = ctx->pages_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); - for (bc_slist_t *tmp = (*ctx)->copy_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = ctx->copy_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); return true; diff --git a/src/blogc-make/ctx.h b/src/blogc-make/ctx.h index 2adfc94..294e0d3 100644 --- a/src/blogc-make/ctx.h +++ b/src/blogc-make/ctx.h @@ -73,7 +73,7 @@ void bm_filectx_reload(bm_filectx_t *ctx); void bm_filectx_free(bm_filectx_t *fctx); bm_ctx_t* bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0, bc_error_t **err); -bool bm_ctx_reload(bm_ctx_t **ctx); +bool bm_ctx_reload(bm_ctx_t *ctx); void bm_ctx_free_internal(bm_ctx_t *ctx); void bm_ctx_free(bm_ctx_t *ctx); diff --git a/src/blogc-make/reloader.c b/src/blogc-make/reloader.c index 6b30974..0edbee7 100644 --- a/src/blogc-make/reloader.c +++ b/src/blogc-make/reloader.c @@ -25,7 +25,7 @@ bm_reloader_thread(void *arg) { bm_reloader_t *reloader = arg; while (reloader->running) { - if (!bm_ctx_reload(&(reloader->ctx))) { + if (!bm_ctx_reload(reloader->ctx)) { fprintf(stderr, "blogc-make: warning: failed to reload context. " "retrying in 5 seconds ...\n\n"); sleep(5); |