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

2010-03-18 Thread Dag-Erling Smørgrav
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

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

2010-03-18 Thread Bruce Evans
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

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

2010-03-17 Thread Dag-Erling Smørgrav
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

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

2010-03-16 Thread Bruce Evans
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

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

2010-03-15 Thread Poul-Henning Kamp
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

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

2010-03-15 Thread Bruce Evans
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

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

2010-03-15 Thread Bruce Evans
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 ===

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

2010-03-15 Thread Poul-Henning Kamp
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