]> git.ipfire.org Git - thirdparty/git.git/commitdiff
run-command.c: make "struct parallel_processes" const if possible
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 12 Oct 2022 21:02:28 +0000 (23:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2022 21:12:41 +0000 (14:12 -0700)
Add a "const" to two "struct parallel_processes" parameters where
we're not modifying anything in "pp". For kill_children() we'll call
it from both the signal handler, and from run_processes_parallel()
itself. Adding a "const" there makes it clear that we don't need to
modify any state when killing our children.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c

index 646ea22e39927073c303053b5212be03297501cc..a72c4295adcf17ebf0af05826d4f359284f728f3 100644 (file)
@@ -1540,7 +1540,7 @@ static int default_task_finished(int result,
        return 0;
 }
 
-static void kill_children(struct parallel_processes *pp, int signo)
+static void kill_children(const struct parallel_processes *pp, int signo)
 {
        for (size_t i = 0; i < pp->max_processes; i++)
                if (pp->children[i].state == GIT_CP_WORKING)
@@ -1698,7 +1698,7 @@ static void pp_buffer_stderr(struct parallel_processes *pp, int output_timeout)
        }
 }
 
-static void pp_output(struct parallel_processes *pp)
+static void pp_output(const struct parallel_processes *pp)
 {
        size_t i = pp->output_owner;