Skip to content

Commit e39c9de

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 36d69bf commit e39c9de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run-command.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ static int default_task_finished(int result,
15401540
return 0;
15411541
}
15421542

1543-
static void kill_children(struct parallel_processes *pp, int signo)
1543+
static void kill_children(const struct parallel_processes *pp, int signo)
15441544
{
15451545
for (size_t i = 0; i < pp->max_processes; i++)
15461546
if (pp->children[i].state == GIT_CP_WORKING)
@@ -1698,7 +1698,7 @@ static void pp_buffer_stderr(struct parallel_processes *pp, int output_timeout)
16981698
}
16991699
}
17001700

1701-
static void pp_output(struct parallel_processes *pp)
1701+
static void pp_output(const struct parallel_processes *pp)
17021702
{
17031703
size_t i = pp->output_owner;
17041704

0 commit comments

Comments
 (0)