Thread (581 messages) flat view 581 messages, 16 authors, 2021-10-12

Re: [PATCH v7 11/17] run-command: allow stdin for run_processes_parallel

From: Jonathan Tan <hidden>
Date: 2021-02-01 05:41:47

quoted hunk ↗ jump to hunk
diff --git a/run-command.c b/run-command.c
index ea4d0fb4b1..80c8c97bc1 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1683,6 +1683,9 @@ static int pp_start_one(struct parallel_processes *pp)
 	if (i == pp->max_processes)
 		BUG("bookkeeping is hard");
 
+	/* disallow by default, but allow users to set up stdin if they wish */
+	pp->children[i].process.no_stdin = 1;
+
This makes sense. May be worth a more detailed comment, e.g.:

  By default, do not inherit stdin from the parent process. (If not, all
  children would share it!) Users may overwrite this by having the
  get_next_task function assign 0 to no_stdin and an appropriate integer
  to in.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help