Eric Blake <[EMAIL PROTECTED]> wrote:
> POSIX states that:
> If, at normal process termination, a function registered by the atexit()
> function is called and a portable application needs to stop further exit()
> processing, it must call the _exit() function or the _Exit() function or one 
> of
> the functions which cause abnormal process termination.
>
> However, in the closeout module, close_stdout() invokes error() which invokes
> exit(), and I have seen a lot of uses of atexit(close_stdout) in GNU programs
> that use the closeout module.
>
> Is this potential bug worth addressing?  Or is it portable in practice to use
> exit() inside an atexit() handler to change the exit status, in spite of the
> warning from POSIX?

It must be portable in practice.
There are tests of this behavior that are run as part of
coreutils' "make check" (see tests/help-version), so I doubt
we'll see any problem.


Reply via email to