Eric Blake <[EMAIL PROTECTED]> writes:

> Perhaps we should add an accessor function that sets a static
> variable in the closeout module, defaulting to 0, but that an
> application can call to register any errno that it wants tracked (in
> this case, after failing fflush, m4 would call the accessor to stash
> the ENOSPC), so that when the atexit handler is finally called, the
> stashed errno can be used if close_stream fails but without
> explaining why.

That sounds really tricky.  Much simpler is to say: if you care about
the return value of a function, do the function before you call
'exit'.  Once you're exiting, don't issue any diagnostics: at that
point your only goal is to exit cleanly.  This is the general strategy
that coreutils uses.


Reply via email to