From a243e659399199f7c696d07dd3b3fdcc102162f9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 30 Jan 2020 11:14:31 -0800 Subject: [PATCH] Rename pgroup_mode to pgroup_provenance --- src/exec.cpp | 5 +++-- src/parse_execution.cpp | 2 +- src/proc.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/exec.cpp b/src/exec.cpp index 0bfdd1d1e..a9ac8d910 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -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 &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 &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; diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 2d3dc761b..d4594c9d4 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -1303,7 +1303,7 @@ end_execution_reason_t parse_execution_context_t::run_1_job(tnode_t 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); diff --git a/src/proc.h b/src/proc.h index 6d28861aa..9d8e175c7 100644 --- a/src/proc.h +++ b/src/proc.h @@ -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_; }