[bitbake-devel] [PATCH] daemonize: Flush stdio on exit

Richard Purdie richard.purdie at linuxfoundation.org
Wed Sep 5 17:03:50 UTC 2018


On Fri, 2018-08-24 at 07:57 +0100, Richard Purdie wrote:
> On Wed, 2018-08-22 at 15:33 +0200, Rasmus Villemoes wrote:
> > Well, that's of course better than not getting the output, but
> > there's then the issue of double printing: The intermediate child
> > does _exit(), but the grandparent may have had stuff in the stdio
> > buffers before the very first fork(), and that content would be
> > inherited down to the grandchild. So I think you should (also)
> > explicitly flush stdout and stderr before the first fork().
> 
> You're correct, we should do that. I was thinking we did flush things
> before forking but looking at the code I'm thinking of the fork()
> call
> in bitbake-worker, not the one in daemonize.py.
> 
> I'd happily take a patch if someone wants to work one up!

I fixed this whilst looking at the other logging/buffer issues.

Cheers,

Richard



More information about the bitbake-devel mailing list