mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-12 20:11:51 +00:00
Shell: Silence TCSETPGRP errors when not interactive
This commit is contained in:
parent
57728ef29f
commit
48a1f7e55c
Notes:
sideshowbarker
2024-07-19 00:58:40 +09:00
Author: https://github.com/alimpfard
Commit: 48a1f7e55c
Pull-request: https://github.com/SerenityOS/serenity/pull/4359
Issue: https://github.com/SerenityOS/serenity/issues/4345
Issue: https://github.com/SerenityOS/serenity/issues/4358
1 changed files with 3 additions and 3 deletions
|
@ -817,13 +817,13 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
|
|||
|
||||
pid_t pgid = is_first ? child : (command.pipeline ? command.pipeline->pgid : child);
|
||||
if ((!m_is_subshell && command.should_wait) || command.pipeline) {
|
||||
if (setpgid(child, pgid) < 0)
|
||||
if (setpgid(child, pgid) < 0 && m_is_interactive)
|
||||
perror("setpgid");
|
||||
|
||||
if (!m_is_subshell) {
|
||||
if (tcsetpgrp(STDOUT_FILENO, pgid) != 0)
|
||||
if (tcsetpgrp(STDOUT_FILENO, pgid) != 0 && m_is_interactive)
|
||||
perror("tcsetpgrp(OUT)");
|
||||
if (tcsetpgrp(STDIN_FILENO, pgid) != 0)
|
||||
if (tcsetpgrp(STDIN_FILENO, pgid) != 0 && m_is_interactive)
|
||||
perror("tcsetpgrp(IN)");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue