mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
Kernel: Make DoubleBuffer::try() return KResultOr
This tidies up error propagation in a number of places.
This commit is contained in:
parent
213b8868af
commit
01993d0af3
Notes:
sideshowbarker
2024-07-18 04:31:44 +09:00
Author: https://github.com/awesomekling
Commit: 01993d0af3
8 changed files with 23 additions and 32 deletions
|
@ -18,10 +18,10 @@ static Atomic<int> s_next_fifo_id = 1;
|
|||
|
||||
RefPtr<FIFO> FIFO::try_create(UserID uid)
|
||||
{
|
||||
auto buffer = DoubleBuffer::try_create();
|
||||
if (buffer)
|
||||
return adopt_ref_if_nonnull(new (nothrow) FIFO(uid, buffer.release_nonnull()));
|
||||
return {};
|
||||
auto buffer_or_error = DoubleBuffer::try_create();
|
||||
if (buffer_or_error.is_error())
|
||||
return {};
|
||||
return adopt_ref_if_nonnull(new (nothrow) FIFO(uid, buffer_or_error.release_value()));
|
||||
}
|
||||
|
||||
KResultOr<NonnullRefPtr<OpenFileDescription>> FIFO::open_direction(FIFO::Direction direction)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue