Bruce Evans writes:
> The above is missing purging of stdout and stderr. Someone may have
> freopen()ed these in "rw" mode.
If you did that, you're on your own... :)
I didn't notice that fpurge() is actually a superset of fflush().
> Callers of daemon() shouldn't do this,
> but if fpurge(NULL
On Wed, 17 Mar 2010, [utf-8] Dag-Erling Sm??rgrav wrote:
Bruce Evans writes:
Even if the child causes the flush, the content of stdout and stderr
is not flushed normally since it is redirected to /dev/null. Unflushed
input in stdin is handled more brokenly: although stdin is redirected
to /de
Bruce Evans writes:
> Even if the child causes the flush, the content of stdout and stderr
> is not flushed normally since it is redirected to /dev/null. Unflushed
> input in stdin is handled more brokenly: although stdin is redirected
> to /dev/null, input on it can still be read via stdin's buf
On Mon, 15 Mar 2010, Poul-Henning Kamp wrote:
In message <20100316024446.a24...@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, exce
In message <20100316024446.a24...@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 o
On Tue, 16 Mar 2010, Bruce Evans wrote:
...
The unobvious points are:
- why avoid triggering atexit(), etc. processing in daemon()?
- why isn't this documented? Some callers of daemon() need to know that
it won't flush open streams, etc., so that they can flush and their
open streams, etc., b
On Mon, 15 Mar 2010, Poul-Henning Kamp wrote:
Log:
Comment a fine point, so it does not get lost when people borrow code
from FreeBSD for other purposes.
Modified:
head/lib/libc/gen/daemon.c
Modified: head/lib/libc/gen/daemon.c
===
Author: phk
Date: Mon Mar 15 08:58:35 2010
New Revision: 205165
URL: http://svn.freebsd.org/changeset/base/205165
Log:
Comment a fine point, so it does not get lost when people borrow code
from FreeBSD for other purposes.
Modified:
head/lib/libc/gen/daemon.c
Modified: head/lib/libc/gen/dae