mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Kernel: Closing a file descriptor should not always close the file
When there is more than one file descriptor for a file closing one of them should not close the underlying file. Previously this relied on the file's ref_count() but at least for sockets this didn't work reliably.
This commit is contained in:
committed by
Andreas Kling
parent
cae33305b0
commit
7a1d09ef1a
@@ -43,4 +43,15 @@ KResultOr<Region*> File::mmap(Process&, FileDescription&, const Range&, u64, int
|
||||
return ENODEV;
|
||||
}
|
||||
|
||||
KResult File::attach(FileDescription&)
|
||||
{
|
||||
m_attach_count++;
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
void File::detach(FileDescription&)
|
||||
{
|
||||
m_attach_count--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user