diff options
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r-- | bitbake/lib/bb/build.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index c79354b3f1..3e2a94edb1 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -41,8 +41,6 @@ from bb import data, event, utils | |||
41 | bblogger = logging.getLogger('BitBake') | 41 | bblogger = logging.getLogger('BitBake') |
42 | logger = logging.getLogger('BitBake.Build') | 42 | logger = logging.getLogger('BitBake.Build') |
43 | 43 | ||
44 | NULL = open(os.devnull, 'r+') | ||
45 | |||
46 | __mtime_cache = {} | 44 | __mtime_cache = {} |
47 | 45 | ||
48 | def cached_mtime_noerror(f): | 46 | def cached_mtime_noerror(f): |
@@ -533,7 +531,6 @@ def _exec_task(fn, task, d, quieterr): | |||
533 | self.triggered = True | 531 | self.triggered = True |
534 | 532 | ||
535 | # Handle logfiles | 533 | # Handle logfiles |
536 | si = open('/dev/null', 'r') | ||
537 | try: | 534 | try: |
538 | bb.utils.mkdirhier(os.path.dirname(logfn)) | 535 | bb.utils.mkdirhier(os.path.dirname(logfn)) |
539 | logfile = open(logfn, 'w') | 536 | logfile = open(logfn, 'w') |
@@ -547,7 +544,8 @@ def _exec_task(fn, task, d, quieterr): | |||
547 | ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()] | 544 | ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()] |
548 | 545 | ||
549 | # Replace those fds with our own | 546 | # Replace those fds with our own |
550 | os.dup2(si.fileno(), osi[1]) | 547 | with open('/dev/null', 'r') as si: |
548 | os.dup2(si.fileno(), osi[1]) | ||
551 | os.dup2(logfile.fileno(), oso[1]) | 549 | os.dup2(logfile.fileno(), oso[1]) |
552 | os.dup2(logfile.fileno(), ose[1]) | 550 | os.dup2(logfile.fileno(), ose[1]) |
553 | 551 | ||
@@ -608,7 +606,6 @@ def _exec_task(fn, task, d, quieterr): | |||
608 | os.close(osi[0]) | 606 | os.close(osi[0]) |
609 | os.close(oso[0]) | 607 | os.close(oso[0]) |
610 | os.close(ose[0]) | 608 | os.close(ose[0]) |
611 | si.close() | ||
612 | 609 | ||
613 | logfile.close() | 610 | logfile.close() |
614 | if os.path.exists(logfn) and os.path.getsize(logfn) == 0: | 611 | if os.path.exists(logfn) and os.path.getsize(logfn) == 0: |