mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Kernel: Make InodeWatcher::crate API OOM safe
This commit is contained in:
parent
c8758d4faa
commit
0d50d3ed1e
3 changed files with 21 additions and 7 deletions
|
@ -21,7 +21,11 @@ KResultOr<int> Process::sys$create_inode_watcher(u32 flags)
|
|||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
auto description_or_error = FileDescription::create(*InodeWatcher::create());
|
||||
auto watcher_or_error = InodeWatcher::create();
|
||||
if (watcher_or_error.is_error())
|
||||
return watcher_or_error.error();
|
||||
|
||||
auto description_or_error = FileDescription::create(*watcher_or_error.value());
|
||||
if (description_or_error.is_error())
|
||||
return description_or_error.error();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue