Kernel: Propagate a few KResults properly in FileSystem subsystems

Propagating un-obsevered KResults up the stack.
This commit is contained in:
Brian Gianforcaro 2020-08-05 02:07:31 -07:00 committed by Andreas Kling
commit d67069d922
Notes: sideshowbarker 2024-07-19 04:16:58 +09:00
5 changed files with 20 additions and 8 deletions

View file

@ -55,7 +55,9 @@ void TTY::set_default_termios()
KResultOr<size_t> TTY::read(FileDescription&, size_t, u8* buffer, size_t size)
{
if (Process::current()->pgid() != pgid()) {
Process::current()->send_signal(SIGTTIN, nullptr);
KResult result = Process::current()->send_signal(SIGTTIN, nullptr);
if (result.is_error())
return result;
return KResult(-EINTR);
}
@ -91,7 +93,9 @@ KResultOr<size_t> TTY::read(FileDescription&, size_t, u8* buffer, size_t size)
KResultOr<size_t> TTY::write(FileDescription&, size_t, const u8* buffer, size_t size)
{
if (Process::current()->pgid() != pgid()) {
Process::current()->send_signal(SIGTTOU, nullptr);
KResult result = Process::current()->send_signal(SIGTTOU, nullptr);
if (result.is_error())
return result;
return KResult(-EINTR);
}