From 74f6f1e7810c6e6c1f2e3951b109d15ebb4e661b Mon Sep 17 00:00:00 2001 From: gambas Date: Tue, 2 Feb 2021 23:46:00 +0100 Subject: [PATCH] Wait for remaining background jobs after a compilation error has been reported. [COMPILER] * BUG: Wait for remaining background jobs after a compilation error has been reported. --- main/gbc/gbc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/gbc/gbc.c b/main/gbc/gbc.c index 497b28519..f6a33631c 100644 --- a/main/gbc/gbc.c +++ b/main/gbc/gbc.c @@ -433,7 +433,14 @@ static void wait_for_task(void) if (!WIFEXITED(status)) THROW("A child process has failed"); if (WEXITSTATUS(status)) + { + while (_ntask > 0) + { + wait(&status); + _ntask--; + } exit(1); + } if (COMP_verbose) fprintf(stderr, "gbc" GAMBAS_VERSION_STRING ": end task %d\n", pid);