[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: closeout bug?
From: |
Jim Meyering |
Subject: |
Re: closeout bug? |
Date: |
Fri, 21 Jul 2006 16:45:01 +0200 |
Eric Blake <address@hidden> 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.
- closeout bug?, Eric Blake, 2006/07/21
- Re: closeout bug?,
Jim Meyering <=