mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-22 12:15:32 +08:00
Revert "Fix undefined behavior in closing a moved pipe"
There is no undefined behavior in closing a moved pipe, since the
move constructor simply sets the fd to -1, which is ignored by close().
The move constructor of autoclose_fd_t is "fully specified" (like
unique_ptr).
It's good practice to eagerly close pipes which may be inherited by
child processes, since otherwise the writer may not get EPIPE correctly.
Closing the pipe explicitly makes it clear that the pipe does not stay
open across continue_job().
This reverts commit c014c23662
.
This commit is contained in:
parent
65b34a12c0
commit
284427a6da
|
@ -1100,6 +1100,7 @@ bool exec_job(parser_t &parser, const shared_ptr<job_t> &j, const io_chain_t &bl
|
|||
}
|
||||
procs_launched += 1;
|
||||
}
|
||||
pipe_next_read.close();
|
||||
|
||||
// If our pipeline was aborted before any process was successfully launched, then there is
|
||||
// nothing to reap, and we can perform an early return.
|
||||
|
|
Loading…
Reference in New Issue
Block a user