From: Johannes Sixt Date: Tue, 01 Mar 2016 07:13:45 GMT Subject: Re: [PATCH] run-command: do not pass child process data into callbacks Message-ID: <56D54129.4090007@kdbg.org> In-Reply-To: <1456783026-3328-1-git-send-email-sbeller@google.com> Am 29.02.2016 um 22:57 schrieb Stefan Beller: > The expected way to pass data into the callback is to pass them via > the customizable callback pointer. The error reporting in > default_{start_failure, task_finished} is not user friendly enough, that > we want to encourage using the child data for such purposes. > > Furthermore the struct child data is cleaned by the run-command API, > before we access them in the callbacks, leading to use-after-free > situations. Thanks. The code changes match what I had prototyped. But please squash in this documentation change: diff --git a/run-command.h b/run-command.h index c6a3e42..3d1e59e 100644 --- a/run-command.h +++ b/run-command.h @@ -191,9 +191,8 @@ typedef int (*task_finished_fn)(int result, * (both stdout and stderr) is routed to stderr in a manner that output * from different tasks does not interleave. * - * If start_failure_fn or task_finished_fn are NULL, default handlers - * will be used. The default handlers will print an error message on - * error without issuing an emergency stop. + * start_failure_fn and task_finished_fn can be NULL to omit any + * special handling. */ int run_processes_parallel(int n, get_next_task_fn,