diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-04-19 14:35:21 +0430 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-04-19 16:28:33 +0200 |
commit | efb14e95c434e2f1767ee0129904d7ee76be9c6e (patch) | |
tree | 7ab9feac00a0bcbe6231fcdb1c4fb96ac2c6977f /Userland/Shell | |
parent | 74f0fdab9863970b9d06c083e50fba7093bf6d5e (diff) | |
download | serenity-efb14e95c434e2f1767ee0129904d7ee76be9c6e.zip |
Shell: Don't whine about tcsetpgrp() failing
We intentionally skimp out on checking isatty() before them to cut down
on syscalls, so we should also accept the errors and just let them be.
Closes #6471.
Diffstat (limited to 'Userland/Shell')
-rw-r--r-- | Userland/Shell/Shell.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 296c24a650..b00fc96fea 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -822,10 +822,12 @@ RefPtr<Job> Shell::run_command(const AST::Command& command) perror("setpgid"); if (!m_is_subshell) { - if (tcsetpgrp(STDOUT_FILENO, pgid) != 0 && m_is_interactive) - perror("tcsetpgrp(OUT)"); - if (tcsetpgrp(STDIN_FILENO, pgid) != 0 && m_is_interactive) - perror("tcsetpgrp(IN)"); + // There's no reason to care about the errors here + // either we're in a tty, we're interactive, and this works + // or we're not, and it fails - in which case, we don't need + // stdin/stdout handoff to child processes anyway. + tcsetpgrp(STDOUT_FILENO, pgid); + tcsetpgrp(STDIN_FILENO, pgid); } } |