RE: [AD] documenting minor return values

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


Title: RE: [AD] documenting minor return values

Sorry, I just figured I hadn't answered to this earlier:

> > Which reminds me of a problem Annie is having, being that
> > pack_fclose_chunk does not return anything hinting of an error,
> > though there might be some error writing the temporary file back
> > into the PACKFILE.
>
> What sort of error ?

Any error. Like failing to write the file because of no disk space
available, or media removed, or whatever. Such an error should be
repercuted to the caller, but the normal way to do this would be
to return NULL, but this would be incompatible with the behavior
of some legacy code which rely on NULL not being returned.

> > She has an upcoming patch fixing a security problem with
> temp files used
> > for chunks, and she ran into that ... Trouble with
> returning NULL being
> > that code actually relies on it returning the parent file.
>
> Does the function set allegro_errno ? If no, maybe it's the way to go.

This should only be checked once the function setting it returned
an error, as the standard practice for libcalls is to not zero errno
if no errors occur.

--
Vincent Penquerc'h



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