mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
79fb5522bd
A `NULL` from `readdir` could be the end of stream or an error. The only way to know is to check `errno`, so it must be set to a known value first, like a 0 that POSIX will never use. This patch adds `set_errno`, uses it to clear the value before calling `readdir`, then checks it again after to see the reason for a `NULL`.