Shell: Name the pipe ends correctly

This commit is contained in:
AnotherTest 2020-08-15 20:31:53 +04:30 committed by Andreas Kling
parent 20d4287eaf
commit 217eca3d3f
Notes: sideshowbarker 2024-07-19 03:24:58 +09:00

View file

@ -1135,10 +1135,10 @@ RefPtr<Value> Pipe::run(RefPtr<Shell> shell)
auto last_in_left = left.take_last();
auto first_in_right = right.take_first();
auto pipe_write_end = FdRedirection::create(STDIN_FILENO, -1, Rewiring::Close::Destination);
auto pipe_read_end = FdRedirection::create(STDOUT_FILENO, -1, pipe_write_end, Rewiring::Close::RefreshDestination);
first_in_right.redirections.append(pipe_write_end);
last_in_left.redirections.append(pipe_read_end);
auto pipe_read_end = FdRedirection::create(STDIN_FILENO, -1, Rewiring::Close::Destination);
auto pipe_write_end = FdRedirection::create(STDOUT_FILENO, -1, pipe_read_end, Rewiring::Close::RefreshDestination);
first_in_right.redirections.append(pipe_read_end);
last_in_left.redirections.append(pipe_write_end);
last_in_left.should_wait = false;
last_in_left.is_pipe_source = true;