1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:57:34 +00:00

LibCore+Everywhere: Return an Error from DirIterator::error()

This also removes DirIterator::error_string(), since the same strerror()
string will be included when you print the Error itself. Except in `ls`
which is still using fprintf() for now.
This commit is contained in:
Sam Atkins 2023-03-01 15:55:15 +00:00 committed by Andreas Kling
parent a98ae8f357
commit 774f328783
17 changed files with 44 additions and 46 deletions

View file

@ -158,8 +158,9 @@ static ErrorOr<void> populate_devtmpfs_char_devices_based_on_sysfs()
{
Core::DirIterator di("/sys/dev/char/", Core::DirIterator::SkipParentAndBaseDir);
if (di.has_error()) {
warnln("Failed to open /sys/dev/char - {}", di.error());
return Error::from_errno(di.error());
auto error = di.error();
warnln("Failed to open /sys/dev/char - {}", error);
return error;
}
while (di.has_next()) {
auto entry_name = di.next_path().split(':');