1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:47:34 +00:00

LibCore: Use ErrorOr<T> for Core::File::open()

This commit is contained in:
Andreas Kling 2021-11-07 02:15:10 +01:00
parent fac2550143
commit a7f1f1c34b
24 changed files with 42 additions and 48 deletions

View file

@ -16,6 +16,7 @@
#include <net/if_arp.h>
#include <net/route.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>

View file

@ -8,6 +8,7 @@
#include <LibCore/File.h>
#include <LibCrypto/Checksum/Adler32.h>
#include <LibCrypto/Checksum/CRC32.h>
#include <string.h>
int main(int argc, char** argv)
{

View file

@ -5,7 +5,7 @@
*/
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <string.h>
int main(int argc, char** argv)
{

View file

@ -8,6 +8,7 @@
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <ctype.h>
#include <string.h>
static constexpr size_t LINE_LENGTH_BYTES = 16;

View file

@ -9,6 +9,7 @@
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>

View file

@ -178,7 +178,7 @@ private:
auto file_name = m_input_file_chain.take_first();
auto file_or_error = Core::File::open(file_name, Core::OpenMode::ReadOnly);
if (file_or_error.is_error()) {
warnln("Input file {} could not be opened: {}", file_name, file_or_error.error().string());
warnln("Input file {} could not be opened: {}", file_name, file_or_error.error());
return {};
}
m_input_file = file_or_error.value();