Correct $status for certain pipeline-aborting failures

If we refused to launch a job because of a "pipeline aborting" error,
then it's the caller's responsibility to set $status.

Fixes #7540
This commit is contained in:
ridiculousfish
2020-12-13 17:01:06 -08:00
parent 2caeec24f7
commit 36766ea3d7
3 changed files with 36 additions and 1 deletions

View File

@@ -1391,7 +1391,13 @@ end_execution_reason_t parse_execution_context_t::run_1_job(const ast::job_t &jo
}
// Actually execute the job.
if (!exec_job(*this->parser, job, block_io)) {
if (!exec_job(*parser, job, block_io)) {
// No process in the job successfully launched.
// Ensure statuses are set (#7540).
if (auto statuses = job->get_statuses()) {
parser->set_last_statuses(statuses.value());
parser->libdata().status_count++;
}
remove_job(*this->parser, job.get());
}