mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Utilities: Use new global variables at /sys/kernel/ directory
This commit is contained in:
parent
35c98a031a
commit
9d1ba0e6ad
Notes:
sideshowbarker
2024-07-17 05:06:11 +09:00
Author: https://github.com/supercomputer7
Commit: 9d1ba0e6ad
Pull-request: https://github.com/SerenityOS/serenity/pull/15593
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
21 changed files with 30 additions and 29 deletions
|
@ -25,7 +25,7 @@
|
|||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath inet"));
|
||||
TRY(Core::System::unveil("/proc/net", "r"));
|
||||
TRY(Core::System::unveil("/sys/kernel/net", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
StringView modify_action;
|
||||
|
@ -89,7 +89,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
if (modify_action.is_empty()) {
|
||||
auto file = TRY(Core::File::open("/proc/net/route", Core::OpenMode::ReadOnly));
|
||||
auto file = TRY(Core::File::open("/sys/kernel/net/route", Core::OpenMode::ReadOnly));
|
||||
auto file_contents = file->read_all();
|
||||
auto json = TRY(JsonValue::from_string(file_contents));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue