Re: [AD] possible bug in filetest.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> The problem was that for_each_file() tested against *allegro_errno
> without first clearing it.  I'm going to change it to look like this:
>
>    errno = *allegro_errno = 0;
>    do {
> ...
>    } while (al_findnext ...

IMHO clearing errno in a library function is not very nice: you may want to
call several functions to perform a given task and test only errno at the
end to find out if something went wrong.

But as for_each_file() is IMHO badly flawed (using errno as the abort flag
is dangerous, I was forced to put an 'errno = 0' line in filetest.c because
QNX sometimes sets it unexpectedly), that's probaly needed for the time
being.

However I will strongly argue for getting rid of this behaviour in the
'fixed API' release.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/