mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Don't decompose shared_ptr to raw pointer for exec_job
This commit is contained in:
parent
008eef50f3
commit
419d7a5138
3 changed files with 7 additions and 7 deletions
10
src/exec.cpp
10
src/exec.cpp
|
@ -984,8 +984,8 @@ static bool exec_process_in_job(parser_t &parser, process_t *p, job_t *j,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_job(parser_t &parser, job_t *j) {
|
void exec_job(parser_t &parser, shared_ptr<job_t> j) {
|
||||||
assert(j != nullptr && "null job_t passed to exec_job!");
|
assert(j && "null job_t passed to exec_job!");
|
||||||
|
|
||||||
// Set to true if something goes wrong while exec:ing the job, in which case the cleanup code
|
// Set to true if something goes wrong while exec:ing the job, in which case the cleanup code
|
||||||
// will kick in.
|
// will kick in.
|
||||||
|
@ -1012,7 +1012,7 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j->processes.front()->type == INTERNAL_EXEC) {
|
if (j->processes.front()->type == INTERNAL_EXEC) {
|
||||||
internal_exec(j, std::move(all_ios));
|
internal_exec(j.get(), std::move(all_ios));
|
||||||
DIE("this should be unreachable");
|
DIE("this should be unreachable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1025,7 +1025,7 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
if (!io_buffer->avoid_conflicts_with_io_chain(all_ios)) {
|
if (!io_buffer->avoid_conflicts_with_io_chain(all_ios)) {
|
||||||
// We could not avoid conflicts, probably due to fd exhaustion. Mark an error.
|
// We could not avoid conflicts, probably due to fd exhaustion. Mark an error.
|
||||||
exec_error = true;
|
exec_error = true;
|
||||||
job_mark_process_as_failed(j, j->processes.front().get());
|
job_mark_process_as_failed(j.get(), j->processes.front().get());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,7 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||||
autoclose_fd_t pipe_next_read;
|
autoclose_fd_t pipe_next_read;
|
||||||
for (std::unique_ptr<process_t> &unique_p : j->processes) {
|
for (std::unique_ptr<process_t> &unique_p : j->processes) {
|
||||||
autoclose_fd_t current_read = std::move(pipe_next_read);
|
autoclose_fd_t current_read = std::move(pipe_next_read);
|
||||||
if (!exec_process_in_job(parser, unique_p.get(), j, std::move(current_read),
|
if (!exec_process_in_job(parser, unique_p.get(), j.get(), std::move(current_read),
|
||||||
&pipe_next_read, all_ios, stdout_read_limit)) {
|
&pipe_next_read, all_ios, stdout_read_limit)) {
|
||||||
exec_error = true;
|
exec_error = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
/// command-specific completions.
|
/// command-specific completions.
|
||||||
class job_t;
|
class job_t;
|
||||||
class parser_t;
|
class parser_t;
|
||||||
void exec_job(parser_t &parser, job_t *j);
|
void exec_job(parser_t &parser, std::shared_ptr<job_t> j);
|
||||||
|
|
||||||
/// Evaluate the expression cmd in a subshell, add the outputs into the list l. On return, the
|
/// Evaluate the expression cmd in a subshell, add the outputs into the list l. On return, the
|
||||||
/// status flag as returned bu \c proc_gfet_last_status will not be changed.
|
/// status flag as returned bu \c proc_gfet_last_status will not be changed.
|
||||||
|
|
|
@ -1230,7 +1230,7 @@ parse_execution_result_t parse_execution_context_t::run_1_job(tnode_t<g::job> jo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually execute the job.
|
// Actually execute the job.
|
||||||
exec_job(*this->parser, job.get());
|
exec_job(*this->parser, job);
|
||||||
|
|
||||||
// Only external commands require a new fishd barrier.
|
// Only external commands require a new fishd barrier.
|
||||||
if (job_contained_external_command) {
|
if (job_contained_external_command) {
|
||||||
|
|
Loading…
Reference in a new issue