From 01a6a4f7c4f6a44f3b96eaff2b922d7376885333 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Nov 2021 11:39:36 +0100 Subject: [PATCH] RequestServer: Replace Result use with ErrorOr --- Userland/Services/RequestServer/Protocol.cpp | 4 ++-- Userland/Services/RequestServer/Protocol.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Services/RequestServer/Protocol.cpp b/Userland/Services/RequestServer/Protocol.cpp index 2db08d9685..c7b385b22d 100644 --- a/Userland/Services/RequestServer/Protocol.cpp +++ b/Userland/Services/RequestServer/Protocol.cpp @@ -35,13 +35,13 @@ Protocol::~Protocol() VERIFY_NOT_REACHED(); } -Result Protocol::get_pipe_for_request() +ErrorOr 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] }; diff --git a/Userland/Services/RequestServer/Protocol.h b/Userland/Services/RequestServer/Protocol.h index b153ba8765..98f4a87da1 100644 --- a/Userland/Services/RequestServer/Protocol.h +++ b/Userland/Services/RequestServer/Protocol.h @@ -7,7 +7,6 @@ #pragma once #include -#include #include #include @@ -28,7 +27,7 @@ protected: int read_fd { -1 }; int write_fd { -1 }; }; - static Result get_pipe_for_request(); + static ErrorOr get_pipe_for_request(); private: String m_name;