On Wed, 2009-08-12 at 11:41 -0400, Dmitri Pal wrote:
Ah! Ok, that makes sense.
I opened a ticket (103) to review the collection, INI and ELAPI code
about the use of errno.
I tried not to make this mistake but it seems like I did and you
caught
it - good!
But this grants a better, a more thorough review of this and other
places.
If everything else is Ok please push the patch.
I will then submit different ticket related patches on top of it
later.
In general, where possible it would be better to explicitly return an
error code and not use errno.
errno is known to be prone to this kind of error, especially when you
change existing code. It is extremely simple to forget about errno and
add a new call that resets it.
And you will face this not only internally but also from users of the
API if you force them to check errno for errors.
Please avoid relying/using errno where possible and instead return the
error explicitly.
Simo.