svn commit: r205165 - head/lib/libc/gen
des at des.no
Thu Mar 18 14:09:54 UTC 2010
Bruce Evans <brde at optusnet.com.au> 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) worked right then it would be easy to purge stdout
> and stderr when purging stdin and all other streams (if this is what
> we want to do).
I agree that fpurge(NULL) would be nice, but nothing outside the base
system would use it, since it wouldn't work on older or non-FreeBSD
systems - and I don't mean "wouldn't work" as in "would have no effect
whatsoever", I mean "wouldn't work" as in "immediate SIGSEGV" since our
fpurge() does not check for fp == NULL.
Dag-Erling Smørgrav - des at des.no
More information about the svn-src-head