1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:55:08 +00:00

Shell: Separate fd rewirings from redirections.

This was unnecessarily confusing. When we build up a chain of commands
connected by pipes, we now store the file descriptors of each end of
these pipes as rewirings in a vector. The rewirings are then put into
effect by calls to dup2().
This commit is contained in:
Andreas Kling 2019-06-04 20:36:08 +02:00
parent 59dae9a766
commit 848044b74c
3 changed files with 19 additions and 18 deletions

View file

@ -19,7 +19,7 @@ void Parser::commit_subcommand()
{
if (m_tokens.is_empty())
return;
m_subcommands.append({ move(m_tokens), move(m_redirections) });
m_subcommands.append({ move(m_tokens), move(m_redirections), {} });
}
void Parser::do_pipe()