Re: [PATCH v9 04/14] run-command: add wait_on_exit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 5, 2016, 21:12 UTC
- Message-ID
- <xmqqeg3uo5yt.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1FD7FB64-0F40-47F0-A047-25B91B170E66@gmail.com>
Lars Schneider <larsxschneider@gmail.com> writes:
> OK. Something like the patch below would work nicely.
Yeah, something along that line; it would eliminate the need to worry about a field named "stdin" ;-)
But ...
Show 7 quoted lines
> while (children_to_clean) {
> struct child_to_clean *p = children_to_clean;
> children_to_clean = p->next;
> +
> + if (p->clean_on_exit_handler) {
> + p->clean_on_exit_handler(p->pid, in_signal);
> + }... the application that used run_command() API would want to be able to pass extra piece of data that is appliation-specific for the child being killed, so it may make sense to extend the function signature to take a pointer to "struct child_process" for the child process being killed, together with a new field added to "struct child_process" that is "void *exit_handler_cbdata;", perhaps?