This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in readdir_r errno handling


On 03/01/2012 04:44 PM, David Benjamin wrote:
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

You are correct. I'll make up a patch.


-- Jeff J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]