1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Kernel: Use KResultOr and TRY() for FIFO

This commit is contained in:
Andreas Kling 2021-09-07 13:56:10 +02:00
parent 631b8e90cd
commit ed5d04b0ea
6 changed files with 10 additions and 18 deletions

View file

@ -20,9 +20,7 @@ KResultOr<FlatPtr> Process::sys$pipe(int pipefd[2], int flags)
return EINVAL;
u32 fd_flags = (flags & O_CLOEXEC) ? FD_CLOEXEC : 0;
auto fifo = FIFO::try_create(uid());
if (!fifo)
return ENOMEM;
auto fifo = TRY(FIFO::try_create(uid()));
auto reader_fd_allocation = TRY(m_fds.allocate());
auto writer_fd_allocation = TRY(m_fds.allocate());