瀏覽代碼

DHCPClient: Remove usage of `DeprecatedFile`

Lucas CHOLLET 2 年之前
父節點
當前提交
f92ae03e76
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Userland/Services/DHCPClient/DHCPv4Client.cpp

+ 3 - 3
Userland/Services/DHCPClient/DHCPv4Client.cpp

@@ -14,7 +14,7 @@
 #include <AK/Random.h>
 #include <AK/ScopeGuard.h>
 #include <AK/Try.h>
-#include <LibCore/DeprecatedFile.h>
+#include <LibCore/File.h>
 #include <LibCore/Timer.h>
 #include <stdio.h>
 
@@ -179,9 +179,9 @@ void DHCPv4Client::try_discover_ifs()
 
 ErrorOr<DHCPv4Client::Interfaces> DHCPv4Client::get_discoverable_interfaces()
 {
-    auto file = TRY(Core::DeprecatedFile::open("/sys/kernel/net/adapters", Core::OpenMode::ReadOnly));
+    auto file = TRY(Core::File::open("/sys/kernel/net/adapters"sv, Core::File::OpenMode::Read));
 
-    auto file_contents = file->read_all();
+    auto file_contents = TRY(file->read_until_eof());
     auto json = JsonValue::from_string(file_contents);
 
     if (json.is_error() || !json.value().is_array()) {