aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-29 16:51:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-28 16:59:06 +0000
commit7fb2d6bed06439e59a81dd91798d886ee0a72e99 (patch)
treeeea2b1a657c537ab4b709afe2b3a6f2ea3ce4290
parent92f61dfe409da2fdd7c609cf1125878aad273d04 (diff)
downloadbitbake-contrib-7fb2d6bed06439e59a81dd91798d886ee0a72e99.tar.gz
server/process: Handle short reads
Its possible the read may return a smaller number of characters. Remove the possibility by using a single character to signal the server is ready. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 986e9efc7..eb794e0dd 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -410,9 +410,9 @@ class BitBakeServer(object):
except EOFError:
# Trap the child exitting/closing the pipe and error out
r = None
- if not r or r != "ready":
+ if not r or r[0] != "r":
ready.close()
- bb.error("Unable to start bitbake server")
+ bb.error("Unable to start bitbake server (%s)" % str(r))
if os.path.exists(logfile):
logstart_re = re.compile(self.start_log_format % ('([0-9]+)', '([0-9-]+ [0-9:.]+)'))
started = False
@@ -455,7 +455,7 @@ class BitBakeServer(object):
os.close(self.readypipe)
writer = ConnectionWriter(self.readypipein)
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
- writer.send("ready")
+ writer.send("r")
writer.close()
server.cooker = self.cooker
server.server_timeout = self.configuration.server_timeout