mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
stat: Print an error if 'stat' fails
This commit is contained in:
parent
22efc34ec5
commit
70f707d806
Notes:
sideshowbarker
2024-07-17 21:39:33 +09:00
Author: https://github.com/mrkct Commit: https://github.com/SerenityOS/serenity/commit/70f707d8062 Pull-request: https://github.com/SerenityOS/serenity/pull/11625
1 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
bool had_error = false;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue