Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-12-07 21:26:30 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-08 00:25:15 +0300
commite081a7c3b7290c50c817598e5f2686d068540762 (patch)
treee1b23b79d8067b0d4fe4629c5bc8d8d787958aa2 /http-backend.c
parent18568ee8f8836db5fc1848f2b34e313ac0a86980 (diff)
usage.c API users: use die_message() for "fatal :" + exit 128
Change code that printed its own "fatal: " message and exited with a status code of 128 to use the die_message() function added in a preceding commit. This change also demonstrates why the return value of die_message_routine() needed to be that of "report_fn". We have callers such as the run-command.c::child_err_spew() which would like to replace its error routine with the return value of "get_die_message_routine()". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
-rw-r--r--http-backend.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/http-backend.c b/http-backend.c
index 3d6e2ff17f..982cb62c7c 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -659,8 +659,9 @@ static NORETURN void die_webcgi(const char *err, va_list params)
{
if (dead <= 1) {
struct strbuf hdr = STRBUF_INIT;
+ report_fn die_message_fn = get_die_message_routine();
- vreportf("fatal: ", err, params);
+ die_message_fn(err, params);
http_status(&hdr, 500, "Internal Server Error");
hdr_nocache(&hdr);