From fd42ffa273396b3ba425fe34cc43b62d540187fe Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 21 Jan 2010 16:00:12 +0000 Subject: bitbake/event: If the server disappears, we just exit too Signed-off-by: Richard Purdie --- bitbake/lib/bb/event.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/event.py') diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 7251d78715..b0750e826e 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -22,7 +22,7 @@ BitBake build tools. # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import os, re +import os, re, sys import bb.utils import pickle @@ -80,8 +80,11 @@ def fire(event, d): def worker_fire(event, d): data = "" + pickle.dumps(event) + "" - if os.write(worker_pipe, data) != len (data): - print "Error sending event to server (short write)" + try: + if os.write(worker_pipe, data) != len (data): + print "Error sending event to server (short write)" + except OSError: + sys.exit(1) def fire_from_worker(event, d): if not event.startswith("") or not event.endswith(""): -- cgit v1.2.3