Re: closeout bug?

2006-07-23 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Paul Eggert on 7/22/2006 4:16 PM: 2006-07-22 Paul Eggert [EMAIL PROTECTED] * modules/close-stream: New file. I assume you forgot the cvs add before your checkin, as this did not make it to CVS. I went ahead and added it

Re: closeout bug?

2006-07-22 Thread Paul Eggert
[EMAIL PROTECTED] (Eric Blake) writes: Should we go ahead and delete the atexit module, then? That'd be fine with me. Jim? Hmm, maybe to reduce the effort when patching coreutils to use this new idiom, maybe you should name the two functions int close_stdout_warn and void close_stdout,

closeout bug?

2006-07-21 Thread Eric Blake
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

Re: closeout bug?

2006-07-21 Thread Jim Meyering
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

Re: closeout bug?

2006-07-21 Thread Paul Eggert
Jim Meyering [EMAIL PROTECTED] writes: 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. I'm a bit more cautious here. I think it's possible, for example, that if a

Re: closeout bug?

2006-07-21 Thread Eric Blake
Paul Eggert eggert at CS.UCLA.EDU writes: How about something like this change? It's simple, and it fixes the (perhaps-theoretical) problem. One price we pay is that you must be careful about the order of atexit calls, but coreutils already invokes atexit (close_stdout) first, so that

Re: closeout bug?

2006-07-21 Thread Paul Eggert
Eric Blake [EMAIL PROTECTED] writes: This is a behavior change - previously, you could use close_stdout outside of an atexit handler, and still have atexit handlers invoked on error. Yes, that's true. Should we document this change in the comment at the start of close_stdout (as opposed to

Re: closeout bug?

2006-07-21 Thread Eric Blake
Also, should we make the closeout module depend on the atexit module? I'd say not, since we assume C89 or better these days. As I understand it the atexit module is needed only for SunOS 4 and earlier, which is no longer of concern. Should we go ahead and delete the atexit module, then?