mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 21:10:30 +00:00
Utilities: Use File.error_string() instead of perror(3) in cpp-*
This commit is contained in:
parent
d51072629d
commit
60a4da8e20
Notes:
sideshowbarker
2024-07-18 05:25:10 +09:00
Author: https://github.com/doctor-rd Commit: https://github.com/SerenityOS/serenity/commit/60a4da8e204 Pull-request: https://github.com/SerenityOS/serenity/pull/9561
3 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
perror("open");
|
||||
warnln("Failed to open {}: {}", path, file->error_string());
|
||||
exit(1);
|
||||
}
|
||||
auto content = file->read_all();
|
||||
|
|
|
@ -21,7 +21,7 @@ int main(int argc, char** argv)
|
|||
path = "Source/little/main.cpp";
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
perror("open");
|
||||
warnln("Failed to open {}: {}", path, file->error_string());
|
||||
exit(1);
|
||||
}
|
||||
auto content = file->read_all();
|
||||
|
|
|
@ -19,7 +19,7 @@ int main(int argc, char** argv)
|
|||
args_parser.parse(argc, argv);
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
perror("open");
|
||||
warnln("Failed to open {}: {}", path, file->error_string());
|
||||
exit(1);
|
||||
}
|
||||
auto content = file->read_all();
|
||||
|
|
Loading…
Reference in a new issue