Rename pgroup_mode to pgroup_provenance

This commit is contained in:
ridiculousfish 2020-01-30 11:14:31 -08:00
parent aaaca9773a
commit a243e65939
3 changed files with 5 additions and 4 deletions

View File

@ -206,7 +206,8 @@ static void internal_exec(env_stack_t &vars, job_t *j, const io_chain_t &block_i
/// If our pgroup assignment mode wants us to use the first external proc, then apply it here.
static void maybe_assign_pgid_from_child(const std::shared_ptr<job_t> &j, pid_t child_pid) {
// If our assignment mode is the first process, then assign it.
if (j->pgid == INVALID_PID && j->pgroup_mode == pgroup_provenance_t::first_external_proc) {
if (j->pgid == INVALID_PID &&
j->pgroup_provenance == pgroup_provenance_t::first_external_proc) {
j->pgid = child_pid;
}
}
@ -925,7 +926,7 @@ bool exec_job(parser_t &parser, const shared_ptr<job_t> &j, const job_lineage_t
// Perhaps we know our pgroup already.
assert(j->pgid == INVALID_PID && "Should not yet have a pid.");
switch (j->pgroup_mode) {
switch (j->pgroup_provenance) {
case pgroup_provenance_t::lineage:
assert(*lineage.parent_pgid != INVALID_PID && "pgid should be none, not INVALID_PID");
j->pgid = *lineage.parent_pgid;

View File

@ -1303,7 +1303,7 @@ end_execution_reason_t parse_execution_context_t::run_1_job(tnode_t<g::job> job_
// Clean up the job on failure or cancellation.
if (pop_result == end_execution_reason_t::ok) {
// Set the pgroup assignment mode, now that the job is populated.
job->pgroup_mode = get_pgroup_provenance(job, lineage);
job->pgroup_provenance = get_pgroup_provenance(job, lineage);
// Success. Give the job to the parser - it will clean it up.
parser->job_add(job);

View File

@ -406,7 +406,7 @@ class job_t {
pid_t pgid{INVALID_PID};
/// How the above pgroup is assigned. This should be set at construction and not modified after.
pgroup_provenance_t pgroup_mode{};
pgroup_provenance_t pgroup_provenance{};
/// The id of this job.
job_id_t job_id() const { return job_id_; }