◐ Shell
clean mode source ↗

Message 193579 - Python tracker

I've been staring at the code.  I just realized: we really should call path_error() as soon as possible once we detect the error--as Christian's patch points out, close() will clear the error.  So instead of playing footsie with assigning (further) to errno, I'm leaving the if (dirp == NULL) code where it is.  It won't happen any sooner execution-wise; moving the close up only makes it slightly(?) easier to read, at the expense of duplicating some code.

Christian, the simplicity of your patch misses one minor point: when FDOPENDIR is not defined, fd is never used, and therefore emits a warning.  I was trying to clean that up at the same time as fixing this bug.