1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Shell: Rename {source,dest}_fd to {old,new}_fd

This makes `Rewiring' much more understandable, and un-confuses the uses
of `dup2()'.
Also fixes `dup2()' bugs.
This commit is contained in:
AnotherTest 2020-10-27 21:38:37 +03:30 committed by Andreas Kling
parent 0bc758d34a
commit f4b7a688b1
4 changed files with 74 additions and 54 deletions

View file

@ -823,7 +823,7 @@ bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<A
SavedFileDescriptors fds { rewirings };
for (auto& rewiring : rewirings) {
int rc = dup2(rewiring.dest_fd, rewiring.source_fd);
int rc = dup2(rewiring.old_fd, rewiring.new_fd);
if (rc < 0) {
perror("dup2(run)");
return false;