| 1599 | } |
| 1600 | |
| 1601 | static void pp_cleanup(struct parallel_processes *pp, |
| 1602 | const struct run_process_parallel_opts *opts) |
| 1603 | { |
| 1604 | trace_printf("run_processes_parallel: done"); |
| 1605 | for (size_t i = 0; i < opts->processes; i++) { |
| 1606 | strbuf_release(&pp->children[i].err); |
| 1607 | child_process_clear(&pp->children[i].process); |
| 1608 | } |
| 1609 | |
| 1610 | free(pp->children); |
| 1611 | free(pp->pfd); |
| 1612 | |
| 1613 | /* |
| 1614 | * When get_next_task added messages to the buffer in its last |
| 1615 | * iteration, the buffered output is non empty. |
| 1616 | */ |
| 1617 | strbuf_write(&pp->buffered_output, stderr); |
| 1618 | strbuf_release(&pp->buffered_output); |
| 1619 | |
| 1620 | sigchain_pop_common(); |
| 1621 | } |
| 1622 | |
| 1623 | /* returns |
| 1624 | * 0 if a new task was started. |
no test coverage detected