svn commit: r205165 - head/lib/libc/gen

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Mar 15 18:15:08 UTC 2010


In message <20100316024446.A24853 at delplex.bde.org>, Bruce Evans writes:
>On Tue, 16 Mar 2010, Bruce Evans wrote:
>

>Due to the way that daemon() works, it is really an error to have any
>open streams when it is called.  This is also undocumented, except
>implicitly.  The errors are:
>- unflushed output on stdout and stderr won't get flushed normally by
>   the child.  stdout and stderr are redirected so it will go there if
>   the child erroneously (?) uses these streams or simply calls exit()
>   which will give the default flush.

The in-core FILE buffers are copied in the child process, so they
should most certainly not be flushed, but rather, as they correctly
are, discarded, so that when the child causes the flush, the content
is only output once.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the svn-src-head mailing list