diff options
-rwxr-xr-x | bitbake/bin/bitbake-worker | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index c429dc76d7..5f6543b7e9 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -80,7 +80,7 @@ def worker_flush(): | |||
80 | written = os.write(worker_pipe, worker_queue) | 80 | written = os.write(worker_pipe, worker_queue) |
81 | worker_queue = worker_queue[written:] | 81 | worker_queue = worker_queue[written:] |
82 | except (IOError, OSError) as e: | 82 | except (IOError, OSError) as e: |
83 | if e.errno != errno.EAGAIN: | 83 | if e.errno != errno.EAGAIN and e.errno != errno.EPIPE: |
84 | raise | 84 | raise |
85 | 85 | ||
86 | def worker_child_fire(event, d): | 86 | def worker_child_fire(event, d): |
@@ -158,6 +158,7 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat | |||
158 | signal.signal(signal.SIGTERM, sigterm_handler) | 158 | signal.signal(signal.SIGTERM, sigterm_handler) |
159 | # Let SIGHUP exit as SIGTERM | 159 | # Let SIGHUP exit as SIGTERM |
160 | signal.signal(signal.SIGHUP, sigterm_handler) | 160 | signal.signal(signal.SIGHUP, sigterm_handler) |
161 | bb.utils.signal_on_parent_exit("SIGTERM") | ||
161 | 162 | ||
162 | # Save out the PID so that the event can include it the | 163 | # Save out the PID so that the event can include it the |
163 | # events | 164 | # events |
@@ -297,7 +298,11 @@ class BitbakeWorker(object): | |||
297 | (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1) | 298 | (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1) |
298 | if self.input in ready: | 299 | if self.input in ready: |
299 | try: | 300 | try: |
300 | self.queue = self.queue + self.input.read() | 301 | r = self.input.read() |
302 | if len(r) == 0: | ||
303 | # EOF on pipe, server must have terminated | ||
304 | self.sigterm_exception(signal.SIGTERM, None) | ||
305 | self.queue = self.queue + r | ||
301 | except (OSError, IOError): | 306 | except (OSError, IOError): |
302 | pass | 307 | pass |
303 | if len(self.queue): | 308 | if len(self.queue): |