@@ -1628,6 +1628,14 @@ static int pp_start_one(struct parallel_processes *pp)
if (i == pp->max_processes)
BUG("bookkeeping is hard");
+ /*
+ * By default, do not inherit stdin from the parent process - otherwise,
+ * all children would share stdin! Users may overwrite this to provide
+ * something to the child's stdin by having their 'get_next_task'
+ * callback assign 0 to .no_stdin and an appropriate integer to .in.
+ */
+ pp->children[i].process.no_stdin = 1;
+
code = pp->get_next_task(&pp->children[i].process,
&pp->children[i].err,
pp->data,
@@ -1639,7 +1647,6 @@ static int pp_start_one(struct parallel_processes *pp)
}
pp->children[i].process.err = -1;
pp->children[i].process.stdout_to_stderr = 1;
- pp->children[i].process.no_stdin = 1;
if (start_command(&pp->children[i].process)) {
code = pp->start_failure(&pp->children[i].err,