Skip to content

Commit 60a4da8

Browse files
doctor-rdawesomekling
authored andcommitted
Utilities: Use File.error_string() instead of perror(3) in cpp-*
1 parent d510726 commit 60a4da8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Userland/Utilities/cpp-lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main(int argc, char** argv)
1717

1818
auto file = Core::File::construct(path);
1919
if (!file->open(Core::OpenMode::ReadOnly)) {
20-
perror("open");
20+
warnln("Failed to open {}: {}", path, file->error_string());
2121
exit(1);
2222
}
2323
auto content = file->read_all();

Userland/Utilities/cpp-parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main(int argc, char** argv)
2121
path = "Source/little/main.cpp";
2222
auto file = Core::File::construct(path);
2323
if (!file->open(Core::OpenMode::ReadOnly)) {
24-
perror("open");
24+
warnln("Failed to open {}: {}", path, file->error_string());
2525
exit(1);
2626
}
2727
auto content = file->read_all();

Userland/Utilities/cpp-preprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(int argc, char** argv)
1919
args_parser.parse(argc, argv);
2020
auto file = Core::File::construct(path);
2121
if (!file->open(Core::OpenMode::ReadOnly)) {
22-
perror("open");
22+
warnln("Failed to open {}: {}", path, file->error_string());
2323
exit(1);
2424
}
2525
auto content = file->read_all();

0 commit comments

Comments
 (0)