[compiler-rt] r186109 - Fix a veritable conucopia of bugs in the readdir_r interceptors.

Chandler Carruth chandlerc at gmail.com
Fri Jul 12 05:26:21 PDT 2013


On Fri, Jul 12, 2013 at 5:12 AM, Alexey Samsonov <samsonov at google.com>wrote:

> Here's what I get from "man readdir_r":
>
> It reads the next directory entry from the directory stream dirp, and
> returns it in the caller-allocated buffer pointed to by entry.
> So this _looks like_ we may assume that *entry is indeed overwritten in
> the original function.
> That said, I'm ok with the changes you've made.
>

Heh, the POSIX spec makes things more clear: "Upon successful return, the
pointer returned at *result shall have the same value as the argument
entry. Upon reaching the end of the directory stream, this pointer shall
have the value NULL."

However, I still mildly prefer referencing *result...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130712/8a320721/attachment.html>


More information about the llvm-commits mailing list