On 12/4/06, Andrew Church <[EMAIL PROTECTED]> wrote:
Personally, I've had my eye on getting rid of import_exit()
entirely, returning an error code from the decode/extract/etc. function
instead. Seeing as that's not done yet, I suppose import_exit() is the
only option, but I'd rather avoid a routine like the import_write() you
suggest that exits on error, and instead have the check and bail at the
point where fwrite() is called; that'll make it easier to go through and
just replace all the import_exit() calls with error returns later.
well a little more digging shows that apparently fwrite is not the
preferred method. Most other modules use p_write, which in turn calls
xio_write, which in turn either calls write or a handler specific for
that descriptor. Also p_write is interrupt safe, though I think
fwrite provides that same protection. The only other thing fwrite
does is give you buffered output, but I don't think that is very
important for the decoders (which are already outputting more than
they are inputting!).
Also, all the callers of p_write check the return value. I'll send
out a patch that converts the fwrite's to p_write's, to bring those
modules up to date.
--
Scott