diff options
authorJason Wessel <>2012-09-17 22:43:31 (GMT)
committerRichard Purdie <>2012-09-24 14:35:32 (GMT)
commit88429f018bbb15749f31067d5e7bf33c21b15f92 (patch)
parent98ac5e4e6230095487b819b911890ec64e28d5f7 (diff)
bitbake: bitbake: Unbuffer stdout for log files
It is possible to lose critical log data when python exits in an unorderly fashion via segmentation fault or certain types of crashes. This is because the buffer characteristics are inherited from the top level stdout, which should be set to unbuffered, for the purpose of all the forked children. This pushes the buffering to the OS, instead of having python managing the buffers in its stream handler class. This change is also to provide the ability to tail logs written from processes in "real time" because they would be written in an orderly fashion depending upon the OS characteristics for the file I/O. (Bitbake rev: c6a367bc3224adafca698a4ffc5414ad83842c16) Signed-off-by: Jason Wessel <> Signed-off-by: Richard Purdie <>
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 8c46024..37c1045 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -43,6 +43,14 @@ from bb import server
43__version__ = "1.15.3" 43__version__ = "1.15.3"
44logger = logging.getLogger("BitBake") 44logger = logging.getLogger("BitBake")
45 45
46# Unbuffer stdout to avoid log truncation in the event
47# of an unorderly exit as well as to provide timely
48# updates to log files for use with tail
50 if == '<stdout>':
51 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
53 pass
46 54
47class BBConfiguration(object): 55class BBConfiguration(object):
48 """ 56 """