Hi William, Willy,

Op 29-12-2017 om 11:35 schreef William Lallemand:
On Fri, Dec 29, 2017 at 10:46:40AM +0100, Willy Tarreau wrote:
Hi William,

In fact it still doesn't fclose() the streams, which worries me a little bit
for the long term, because eventhough any printf() will end up being written
into /dev/null, it's still preferable to mark the FILE* as being closed and
only then reopen 0,1,2 to ensure they cannot be abusively reused. It will
also remove some confusion in strace by avoiding seeing some spurious fcntl()
or write(2, foo, strlen(foo)) being sent there caused by alerts for example.
[...]
Otherwise I'm reasonably confident that this should be enough to close
all pending issues related to the master-worker now.

Willy

I agree, it's better to merge them with fclose()

But shouldn't be needed, as i read dup2 will close them?

"int dup2(int oldfd, int newfd);" "closing/newfd/first if necessary" https://linux.die.net/man/2/dup2 Regards, PiBa-NL / Pieter

Reply via email to