On Tue, Jun 25, 2013 at 01:51:48PM +0200, Armin Rigo wrote:

> According to these mails, the issue you've hit is different: what occurs to
> errno if readdir() returns NULL.  This is indeed strange but documented.
> But what occurs to errno if readdir() does *not* return NULL?  I thought
> that errno would not be modified in this case, but as far as I know the
> Posix man page is silent on the subject, and it might be the cause of
> Vasily's report.

The point that eventually became clear to me is that returning NULL and
setting errno are not necessarily connected, which was the original mistake I
made. errors can happen (and errno set) even if readdir hasn't hit the end of
the directory (so NULL need not be returned). Linux's man page is, unusually,
clearer than OpenBSD's in this regard, though it's so long and lawyerly that
it's still hard to work out what's going on! I had to read OpenBSD's source
code to work this out last year :/


Laurie
-- 
Personal                                             http://tratt.net/laurie/
Software Development Team                                http://soft-dev.org/
   https://github.com/ltratt              http://twitter.com/laurencetratt
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to