diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-05-12 13:56:43 +0430 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-12 11:00:45 +0100 |
commit | a91a49337c5992d64b30f493eea1eb492792b667 (patch) | |
tree | b665e2c0b31a9935ca8a8f8b5b71bbadf476e32f /Userland/Services | |
parent | 422ef7904e9eb6be1182421a7529ed0d5e00991f (diff) | |
download | serenity-a91a49337c5992d64b30f493eea1eb492792b667.zip |
LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/AudioServer/Mixer.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/CrashDaemon/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/DHCPClient/DHCPv4Client.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/FileOperation/main.cpp | 4 | ||||
-rw-r--r-- | Userland/Services/LookupServer/LookupServer.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/LookupServer/MulticastDNS.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/SystemServer/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/WebServer/Client.cpp | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Services/AudioServer/Mixer.cpp b/Userland/Services/AudioServer/Mixer.cpp index e05c80d0ec..a2e2a9c424 100644 --- a/Userland/Services/AudioServer/Mixer.cpp +++ b/Userland/Services/AudioServer/Mixer.cpp @@ -23,7 +23,7 @@ Mixer::Mixer() }, "AudioServer[mixer]")) { - if (!m_device->open(Core::IODevice::WriteOnly)) { + if (!m_device->open(Core::OpenMode::WriteOnly)) { dbgln("Can't open audio device: {}", m_device->error_string()); return; } diff --git a/Userland/Services/CrashDaemon/main.cpp b/Userland/Services/CrashDaemon/main.cpp index 0f04d4d04c..ddf2472597 100644 --- a/Userland/Services/CrashDaemon/main.cpp +++ b/Userland/Services/CrashDaemon/main.cpp @@ -46,7 +46,7 @@ static bool compress_coredump(const String& coredump_path) return false; } auto output_path = String::formatted("{}.gz", coredump_path); - auto output_file_or_error = Core::File::open(output_path, Core::File::WriteOnly); + auto output_file_or_error = Core::File::open(output_path, Core::OpenMode::WriteOnly); if (output_file_or_error.is_error()) { dbgln("Could not open '{}' for writing: {}", output_path, output_file_or_error.error()); return false; diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index a75538372f..78039b2f69 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -169,7 +169,7 @@ void DHCPv4Client::try_discover_deferred_ifs() Result<DHCPv4Client::Interfaces, String> DHCPv4Client::get_discoverable_interfaces() { auto file = Core::File::construct("/proc/net/adapters"); - if (!file->open(Core::IODevice::ReadOnly)) { + if (!file->open(Core::OpenMode::ReadOnly)) { dbgln("Error: Failed to open /proc/net/adapters: {}", file->error_string()); return String { file->error_string() }; } diff --git a/Userland/Services/FileOperation/main.cpp b/Userland/Services/FileOperation/main.cpp index f35f2ccc8d..632f7e721c 100644 --- a/Userland/Services/FileOperation/main.cpp +++ b/Userland/Services/FileOperation/main.cpp @@ -127,12 +127,12 @@ int perform_copy(const String& source, const String& destination) continue; } VERIFY(item.type == WorkItem::Type::CopyFile); - auto source_file_or_error = Core::File::open(item.source, Core::File::ReadOnly); + auto source_file_or_error = Core::File::open(item.source, Core::OpenMode::ReadOnly); if (source_file_or_error.is_error()) { report_warning(String::formatted("Failed to open {} for reading: {}", item.source, source_file_or_error.error())); return 1; } - auto destination_file_or_error = Core::File::open(item.destination, (Core::IODevice::OpenMode)(Core::File::WriteOnly | Core::File::Truncate)); + auto destination_file_or_error = Core::File::open(item.destination, (Core::OpenMode)(Core::OpenMode::WriteOnly | Core::OpenMode::Truncate)); if (destination_file_or_error.is_error()) { report_warning(String::formatted("Failed to open {} for write: {}", item.destination, destination_file_or_error.error())); return 1; diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 5a3cb01360..52eb6a4752 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -79,7 +79,7 @@ void LookupServer::load_etc_hosts() }; auto file = Core::File::construct("/etc/hosts"); - if (!file->open(Core::IODevice::ReadOnly)) + if (!file->open(Core::OpenMode::ReadOnly)) return; while (!file->eof()) { auto line = file->read_line(1024); diff --git a/Userland/Services/LookupServer/MulticastDNS.cpp b/Userland/Services/LookupServer/MulticastDNS.cpp index 93223d4bd2..31131c2a46 100644 --- a/Userland/Services/LookupServer/MulticastDNS.cpp +++ b/Userland/Services/LookupServer/MulticastDNS.cpp @@ -114,7 +114,7 @@ ssize_t MulticastDNS::emit_packet(const DNSPacket& packet, const sockaddr_in* de Vector<IPv4Address> MulticastDNS::local_addresses() const { auto file = Core::File::construct("/proc/net/adapters"); - if (!file->open(Core::IODevice::ReadOnly)) { + if (!file->open(Core::OpenMode::ReadOnly)) { dbgln("Failed to open /proc/net/adapters: {}", file->error_string()); return {}; } diff --git a/Userland/Services/SystemServer/main.cpp b/Userland/Services/SystemServer/main.cpp index 6a9dc97587..36022987b2 100644 --- a/Userland/Services/SystemServer/main.cpp +++ b/Userland/Services/SystemServer/main.cpp @@ -50,7 +50,7 @@ static void sigchld_handler(int) static void parse_boot_mode() { auto f = Core::File::construct("/proc/cmdline"); - if (!f->open(Core::IODevice::ReadOnly)) { + if (!f->open(Core::OpenMode::ReadOnly)) { dbgln("Failed to read command line: {}", f->error_string()); return; } diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index ca9931abbf..bdde301e5d 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -103,7 +103,7 @@ void Client::handle_request(ReadonlyBytes raw_request) } auto file = Core::File::construct(real_path); - if (!file->open(Core::File::ReadOnly)) { + if (!file->open(Core::OpenMode::ReadOnly)) { send_error_response(404, "Not found!", request); return; } |