Bug in readdir_r errno handling

David Benjamin davidben@MIT.EDU
Thu Mar 1 23:35:00 GMT 2012


readdir_r in newlib/libc/posix/readdir_r.c returns errno if getdents
fails or reaches the end of the directory (a return of 0). But
getdents only sets errno on negative returns. If a previous library
call had failed and set errno, it would keep this value and readdir_r
returns an error instead of 0 on EOF.

David Benjamin



More information about the Newlib mailing list