[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: failure with HEAD: stdin seekable
From: |
Paul Eggert |
Subject: |
Re: failure with HEAD: stdin seekable |
Date: |
Tue, 19 Dec 2006 00:59:47 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Eric Blake <address@hidden> 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.