mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +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
1 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,10 @@ bool DirIterator::advance_next()
|
||||||
errno = 0;
|
errno = 0;
|
||||||
auto* de = readdir(m_dir);
|
auto* de = readdir(m_dir);
|
||||||
if (!de) {
|
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();
|
m_next.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue