summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-xbitbake/lib/bb/main.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 761ea459cf..b296ef8b8c 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -27,6 +27,7 @@ import sys
27import logging 27import logging
28import optparse 28import optparse
29import warnings 29import warnings
30import fcntl
30 31
31import bb 32import bb
32from bb import event 33from bb import event
@@ -336,10 +337,7 @@ def start_server(servermodule, configParams, configuration, features):
336 server.saveConnectionDetails() 337 server.saveConnectionDetails()
337 except Exception as e: 338 except Exception as e:
338 while hasattr(server, "event_queue"): 339 while hasattr(server, "event_queue"):
339 try: 340 import queue
340 import queue
341 except ImportError:
342 import Queue as queue
343 try: 341 try:
344 event = server.event_queue.get(block=False) 342 event = server.event_queue.get(block=False)
345 except (queue.Empty, IOError): 343 except (queue.Empty, IOError):
@@ -363,7 +361,10 @@ def bitbake_main(configParams, configuration):
363 # updates to log files for use with tail 361 # updates to log files for use with tail
364 try: 362 try:
365 if sys.stdout.name == '<stdout>': 363 if sys.stdout.name == '<stdout>':
366 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) 364 # Reopen with O_SYNC (unbuffered)
365 fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
366 fl |= os.O_SYNC
367 fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl)
367 except: 368 except:
368 pass 369 pass
369 370