mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00:00
LibCore: Don't record false DirIterator errors
`readdir()` returns null if there is an error, OR if we reached the end. We don't need to create an Error if there wasn't one.
This commit is contained in:
parent
cec8543097
commit
6bcde0dcf4
|
@ -48,7 +48,10 @@ bool DirIterator::advance_next()
|
|||
errno = 0;
|
||||
auto* de = readdir(m_dir);
|
||||
if (!de) {
|
||||
m_error = Error::from_errno(errno);
|
||||
if (errno != 0) {
|
||||
m_error = Error::from_errno(errno);
|
||||
dbgln("DirIteration error: {}", m_error.value());
|
||||
}
|
||||
m_next.clear();
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue