On Fri, Dec 29, 2017 at 11:35:10AM +0100, William Lallemand wrote:
> 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()

OK just done that now. I also added a test for fd > 2 before closing it,
otherwise if you're unlucky and fd #1 is assignd to your new fd for
example, you end up closing it again just after having duplicated it
:-)

Willy

Reply via email to