Преглед изворни кода

Shell: Re-block SIGTT{IN,OU} on start

This also shows up when trying to read from a 0x0 buffer as it has no
PTY attached, avoid the mess by just blocking them (instead of ignoring
them).
Ali Mohammad Pur пре 2 година
родитељ
комит
77cc8c5612
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      Userland/Shell/main.cpp

+ 6 - 0
Userland/Shell/main.cpp

@@ -55,6 +55,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
         s_shell->setup_signals();
 
+        sigset_t blocked;
+        sigemptyset(&blocked);
+        sigaddset(&blocked, SIGTTOU);
+        sigaddset(&blocked, SIGTTIN);
+        pthread_sigmask(SIG_BLOCK, &blocked, nullptr);
+
         shell->termios = editor->termios();
         shell->default_termios = editor->default_termios();