This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Bug in readdir_r errno handling
- From: David Benjamin <davidben at MIT dot EDU>
- To: newlib at sources dot redhat dot com
- Date: Thu, 1 Mar 2012 16:44:01 -0500
- Subject: Bug in readdir_r errno handling
- Authentication-results: mr.google.com; spf=pass (google.com: domain of davidben@mit.edu designates 10.180.107.6 as permitted sender) smtp.mail=davidben@mit.edu
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