mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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
Notes:
sideshowbarker
2024-07-17 00:49:59 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/6bcde0dcf4 Pull-request: https://github.com/SerenityOS/serenity/pull/17894 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/supercomputer7
1 changed files with 4 additions and 1 deletions
|
@ -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