mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:47:34 +00:00
Kernel: Make Process::FileDescriptions::allocate return KResultOr<int>
Modernize more error checking by utilizing KResultOr.
This commit is contained in:
parent
d2cee9cbf6
commit
ba03b6ad02
10 changed files with 48 additions and 37 deletions
|
@ -18,9 +18,10 @@ KResultOr<FlatPtr> Process::sys$create_inode_watcher(u32 flags)
|
|||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
REQUIRE_PROMISE(rpath);
|
||||
|
||||
int fd = m_fds.allocate();
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
auto fd_or_error = m_fds.allocate();
|
||||
if (fd_or_error.is_error())
|
||||
return fd_or_error.error();
|
||||
auto fd = fd_or_error.value();
|
||||
|
||||
auto watcher_or_error = InodeWatcher::create();
|
||||
if (watcher_or_error.is_error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue