This could happen if opendir() failed for a reason other than the directory missing (for example, `opendir("/")` fails with EACCES. Reference Issue #15587.