mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
stat: Print an error if 'stat' fails
This commit is contained in:
parent
22efc34ec5
commit
70f707d806
1 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
bool had_error = false;
|
bool had_error = false;
|
||||||
for (auto& file : files) {
|
for (auto& file : files) {
|
||||||
had_error |= stat(file, should_follow_links).is_error();
|
auto r = stat(file, should_follow_links);
|
||||||
|
if (r.is_error()) {
|
||||||
|
had_error = true;
|
||||||
|
warnln("stat: cannot stat '{}': {}", file, strerror(r.error().code()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return had_error;
|
return had_error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue