mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Revert "Minor refactoring"
This reverts commit 15da6f0203
.
It was meant for the major branch.
This commit is contained in:
parent
a4593d011a
commit
d0ce2b4824
1 changed files with 8 additions and 6 deletions
|
@ -632,8 +632,8 @@ void exec_job(parser_t &parser, job_t *j) {
|
|||
if (blocked_pid != -1) {
|
||||
debug(2, L"Unblocking process %d.\n", blocked_pid);
|
||||
kill(blocked_pid, SIGCONT);
|
||||
blocked_pid = -1;
|
||||
}
|
||||
blocked_pid = -1;
|
||||
};
|
||||
|
||||
// This is the io_streams we pass to internal builtins.
|
||||
|
@ -1174,14 +1174,16 @@ void exec_job(parser_t &parser, job_t *j) {
|
|||
//no one awaits it.
|
||||
}
|
||||
//regardless of whether the child blocked or not:
|
||||
//only once per job, and only once we've actually executed an external command
|
||||
if ((child_spawned || child_forked) && !pgrp_set) {
|
||||
if (child_spawned || child_forked) {
|
||||
//this should be called after waitpid if child_forked && pipes_to_next_command
|
||||
//it can be called at any time if child_spawned
|
||||
if (!pgrp_set) {
|
||||
set_child_group(j, p->pid);
|
||||
//only once per job, and only once we've executed an external command for real
|
||||
//we can't rely on p->is_first_in_job because a builtin may have been the first
|
||||
pgrp_set = true;
|
||||
}
|
||||
}
|
||||
//if the command we ran _before_ this one was SIGSTOP'd to let this one catch up, unblock it now.
|
||||
//this must be after the wait_pid on the process we just started, if any.
|
||||
unblock_previous();
|
||||
|
|
Loading…
Reference in a new issue