1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

RequestServer: Replace Result<T, E> use with ErrorOr<T>

This commit is contained in:
Andreas Kling 2021-11-07 11:39:36 +01:00
parent fbbb87d517
commit 01a6a4f7c4
2 changed files with 3 additions and 4 deletions

View file

@ -35,13 +35,13 @@ Protocol::~Protocol()
VERIFY_NOT_REACHED();
}
Result<Protocol::Pipe, String> Protocol::get_pipe_for_request()
ErrorOr<Protocol::Pipe> Protocol::get_pipe_for_request()
{
int fd_pair[2] { 0 };
if (pipe(fd_pair) != 0) {
auto saved_errno = errno;
dbgln("Protocol: pipe() failed: {}", strerror(saved_errno));
return String { strerror(saved_errno) };
return Error::from_errno(saved_errno);
}
fcntl(fd_pair[1], F_SETFL, fcntl(fd_pair[1], F_GETFL) | O_NONBLOCK);
return Pipe { fd_pair[0], fd_pair[1] };