|
@@ -7,8 +7,8 @@
|
|
|
#include <AK/JsonObject.h>
|
|
|
#include <AK/JsonValue.h>
|
|
|
#include <LibCore/DateTime.h>
|
|
|
-#include <LibCore/File.h>
|
|
|
#include <LibCore/ProcessStatisticsReader.h>
|
|
|
+#include <LibCore/Stream.h>
|
|
|
#include <LibCore/System.h>
|
|
|
#include <LibMain/Main.h>
|
|
|
#include <pwd.h>
|
|
@@ -25,8 +25,9 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|
|
TRY(Core::System::unveil("/sys/kernel/processes", "r"));
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
|
|
|
|
|
- auto file = TRY(Core::File::open("/var/run/utmp", Core::OpenMode::ReadOnly));
|
|
|
- auto json = TRY(JsonValue::from_string(file->read_all()));
|
|
|
+ auto file = TRY(Core::Stream::File::open("/var/run/utmp"sv, Core::Stream::OpenMode::Read));
|
|
|
+ auto file_contents = TRY(file->read_all());
|
|
|
+ auto json = TRY(JsonValue::from_string(file_contents));
|
|
|
if (!json.is_object()) {
|
|
|
warnln("Error: Could not parse /var/run/utmp");
|
|
|
return 1;
|