RequestServer: Replace Result<T, E> use with ErrorOr<T>
This commit is contained in:
parent
fbbb87d517
commit
01a6a4f7c4
Notes:
sideshowbarker
2024-07-18 01:23:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/01a6a4f7c4f
2 changed files with 3 additions and 4 deletions
Userland/Services/RequestServer
|
@ -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] };
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Result.h>
|
||||
#include <AK/URL.h>
|
||||
#include <RequestServer/Forward.h>
|
||||
|
||||
|
@ -28,7 +27,7 @@ protected:
|
|||
int read_fd { -1 };
|
||||
int write_fd { -1 };
|
||||
};
|
||||
static Result<Pipe, String> get_pipe_for_request();
|
||||
static ErrorOr<Pipe> get_pipe_for_request();
|
||||
|
||||
private:
|
||||
String m_name;
|
||||
|
|
Loading…
Add table
Reference in a new issue