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? -- Eric Blake