diff --git a/src/exec.cpp b/src/exec.cpp index 34657b5ce..afa69b2a0 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -1064,13 +1064,13 @@ void exec_job(parser_t &parser, job_t *j) { if (pid == 0) { // This is the child process. p->pid = getpid(); + // the process will be resumed by the shell when the next command in the + // chain is started setup_child_process(j, p, process_net_io_chain); - // Start child processes that are part of a chain in a stopped state + // start child processes that are part of a job in a stopped state // to ensure that they are still running when the next command in the // chain is started. - // The process will be resumed when the next command in the chain is started. - // Note that this may span multiple jobs, as jobs can read from each other. if (pipes_to_next_command) { kill(p->pid, SIGSTOP); } @@ -1081,7 +1081,7 @@ void exec_job(parser_t &parser, job_t *j) { } else { if (pipes_to_next_command) { //it actually blocked itself after forking above, but print in here for output - //synchronization & so we can assign command_blocked in the correct address space + //synchronization and so we can assign blocked_pid in the correct address space debug(2, L"Blocking process %d waiting for next command in chain.\n", pid); command_blocked = true; } @@ -1115,8 +1115,6 @@ void exec_job(parser_t &parser, job_t *j) { blocked_pid = -1; } if (command_blocked) { - //store the newly-blocked command's PID so that it can be SIGCONT'd once the next process - //in the chain is started. That may be in this job or in another job. blocked_pid = p->pid; }