run-command.c: make "struct parallel_processes" const if possible
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>
Ævar Arnfjörð Bjarmason committed
Oct 12, 2022 at 23:02 UTC
e39c9de8607cacee4cc5169c2e014bc59acbbcde
1 file changed
+2
-2
run-command.c
+2
-2
@@ -1540,7 +1540,7 @@ static int default_task_finished(int result,
1540
return 0;
1541
}
1542
1543
-static void kill_children(struct parallel_processes *pp, int signo)
1543
+static void kill_children(const struct parallel_processes *pp, int signo)
1544
{
1545
for (size_t i = 0; i < pp->max_processes; i++)
1546
if (pp->children[i].state == GIT_CP_WORKING)
@@ -1698,7 +1698,7 @@ static void pp_buffer_stderr(struct parallel_processes *pp, int output_timeout)
1698
}
1699
}
1700
1701
-static void pp_output(struct parallel_processes *pp)
1701
+static void pp_output(const struct parallel_processes *pp)
1702
{
1703
size_t i = pp->output_owner;
1704