On Wed, Jan 18, 2017 at 01:25:24PM +0100, Loďc Grenié wrote:
> for Debian -- but I failed the bug report.
>
> To use it, compile it in a directory where you can create a file,
> use it with ./fopen-bug and ./fopen-bug a. The second form (with
> an argument) forks while the first one does not. The output are not
> the same (while I would have expected that they are equal).
Indeed, I get different result with jessie and stretch.
However it seems the issue is due to buffering and the following:
All open stdio(3) streams are flushed and closed.
exit cause the inherited stream to be flushed in the child, but this does not
empty the parent buffer, which is flushed twice.
So pari should either use fflush or _exit.