git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] run-command: do not pass child process data into callbacks

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 1, 2016, 07:13 UTC
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:
Show 8 quoted lines
> 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,
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “run-command: do not pass child process data into callbacks”
  1. run-command: do not pass child process data into callbacksStefan Beller, Feb 29, 2016
  2. Stefan BellerFeb 29, 2016
  3. Junio C HamanoFeb 29, 2016
  4. Johannes SixtMar 1, 2016
  5. Junio C HamanoMar 1, 2016
  6. [PATCHv2] run-command: do not pass child process data into callbacksStefan Beller, Mar 1, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.