mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
FileManager: Restore inline message behavior for inaccessible dirs
Print the correct error from Core::System::chdir() instead of errno, and
display the error in the DirectoryView instead of continuing to show the
previous location's contents.
This regressed in 1dc3ba6ed5
.
This commit is contained in:
parent
477a96820d
commit
6d02403e06
|
@ -408,9 +408,9 @@ bool DirectoryView::open(DeprecatedString const& path)
|
|||
return false;
|
||||
|
||||
auto real_path = error_or_real_path.release_value();
|
||||
if (Core::System::chdir(real_path).is_error()) {
|
||||
perror("chdir");
|
||||
return false;
|
||||
if (auto result = Core::System::chdir(real_path); result.is_error()) {
|
||||
dbgln("Failed to open '{}': {}", real_path, result.error());
|
||||
warnln("Failed to open '{}': {}", real_path, result.error());
|
||||
}
|
||||
|
||||
if (model().root_path() == real_path.to_deprecated_string()) {
|
||||
|
|
Loading…
Reference in a new issue