mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
Kernel: Allow File::close() to fail
And pass the result through to sys$close() return value. Fixes https://github.com/SerenityOS/serenity/issues/427
This commit is contained in:
parent
d4ddb0013c
commit
1b4e88fb59
12 changed files with 23 additions and 15 deletions
|
@ -112,7 +112,7 @@ bool MasterPTY::can_write_from_slave() const
|
|||
return m_buffer.space_for_writing();
|
||||
}
|
||||
|
||||
void MasterPTY::close()
|
||||
KResult MasterPTY::close()
|
||||
{
|
||||
if (ref_count() == 2) {
|
||||
InterruptDisabler disabler;
|
||||
|
@ -122,6 +122,8 @@ void MasterPTY::close()
|
|||
|
||||
m_slave->hang_up();
|
||||
}
|
||||
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
int MasterPTY::ioctl(FileDescription& description, unsigned request, FlatPtr arg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue