mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:45:06 +00:00
Kernel: Make Inode::register_watcher() OOM-fallible
This commit is contained in:
parent
87bd930e7e
commit
a9cd8ca841
3 changed files with 14 additions and 7 deletions
|
@ -154,11 +154,12 @@ bool Inode::unbind_socket()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Inode::register_watcher(Badge<InodeWatcher>, InodeWatcher& watcher)
|
||||
ErrorOr<void> Inode::register_watcher(Badge<InodeWatcher>, InodeWatcher& watcher)
|
||||
{
|
||||
MutexLocker locker(m_inode_lock);
|
||||
VERIFY(!m_watchers.contains(&watcher));
|
||||
m_watchers.set(&watcher);
|
||||
TRY(m_watchers.try_set(&watcher));
|
||||
return {};
|
||||
}
|
||||
|
||||
void Inode::unregister_watcher(Badge<InodeWatcher>, InodeWatcher& watcher)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue