diff options
Diffstat (limited to 'bitbake/lib/bb/process.py')
-rw-r--r-- | bitbake/lib/bb/process.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py index d95a03d176..7c797852ed 100644 --- a/bitbake/lib/bb/process.py +++ b/bitbake/lib/bb/process.py | |||
@@ -83,15 +83,16 @@ def _logged_communicate(pipe, log, input, extrafiles): | |||
83 | bb.utils.nonblockingfd(fobj.fileno()) | 83 | bb.utils.nonblockingfd(fobj.fileno()) |
84 | rin.append(fobj) | 84 | rin.append(fobj) |
85 | 85 | ||
86 | def readextras(): | 86 | def readextras(selected): |
87 | for fobj, func in extrafiles: | 87 | for fobj, func in extrafiles: |
88 | try: | 88 | if fobj in selected: |
89 | data = fobj.read() | 89 | try: |
90 | except IOError as err: | 90 | data = fobj.read() |
91 | if err.errno == errno.EAGAIN or err.errno == errno.EWOULDBLOCK: | 91 | except IOError as err: |
92 | data = None | 92 | if err.errno == errno.EAGAIN or err.errno == errno.EWOULDBLOCK: |
93 | if data is not None: | 93 | data = None |
94 | func(data) | 94 | if data is not None: |
95 | func(data) | ||
95 | 96 | ||
96 | try: | 97 | try: |
97 | while pipe.poll() is None: | 98 | while pipe.poll() is None: |
@@ -114,12 +115,12 @@ def _logged_communicate(pipe, log, input, extrafiles): | |||
114 | errdata.append(data) | 115 | errdata.append(data) |
115 | log.write(data) | 116 | log.write(data) |
116 | 117 | ||
117 | readextras() | 118 | readextras(r) |
118 | 119 | ||
119 | finally: | 120 | finally: |
120 | log.flush() | 121 | log.flush() |
121 | 122 | ||
122 | readextras() | 123 | readextras([fobj for fobj, _ in extrafiles]) |
123 | 124 | ||
124 | if pipe.stdout is not None: | 125 | if pipe.stdout is not None: |
125 | pipe.stdout.close() | 126 | pipe.stdout.close() |