From ccebf8bf592efa6d8b3c6824b71c13665f103cc1 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 14 Sep 2022 16:12:56 +0100 Subject: [PATCH] man: Port to Core::Stream --- Userland/Utilities/man.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp index 5ae6d0ae9d..3aec0a54a7 100644 --- a/Userland/Utilities/man.cpp +++ b/Userland/Utilities/man.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -108,12 +108,12 @@ ErrorOr serenity_main(Main::Arguments arguments) pager_command = String::formatted("less -P 'Manual Page {}({}) line %l?e (END):.'", StringView(name).replace("'"sv, "'\\''"sv, ReplaceMode::FirstOnly), StringView(section).replace("'"sv, "'\\''"sv, ReplaceMode::FirstOnly)); pid_t pager_pid = TRY(pipe_to_pager(pager_command)); - auto file = TRY(Core::File::open(filename, Core::OpenMode::ReadOnly)); + auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Read)); TRY(Core::System::pledge("stdio proc")); - dbgln("Loading man page from {}", file->filename()); - auto buffer = file->read_all(); + dbgln("Loading man page from {}", filename); + auto buffer = TRY(file->read_all()); auto source = String::copy(buffer); const String title("SerenityOS manual");