mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
Kernel: Propagate a few KResults properly in FileSystem subsystems
Propagating un-obsevered KResults up the stack.
This commit is contained in:
parent
c4c6d9367d
commit
d67069d922
5 changed files with 20 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue