mirror of
https://github.com/RGBCube/serenity
synced 2025-06-28 16:32:07 +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
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