diff options
Diffstat (limited to 'poky/bitbake/lib/bb/server/process.py')
-rw-r--r-- | poky/bitbake/lib/bb/server/process.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/poky/bitbake/lib/bb/server/process.py b/poky/bitbake/lib/bb/server/process.py index 828159ed7..0749b5bc3 100644 --- a/poky/bitbake/lib/bb/server/process.py +++ b/poky/bitbake/lib/bb/server/process.py @@ -428,6 +428,8 @@ class BitBakeServer(object): def _startServer(self): print(self.start_log_format % (os.getpid(), datetime.datetime.now().strftime(self.start_log_datetime_format))) + sys.stdout.flush() + server = ProcessServer(self.bitbake_lock, self.sock, self.sockname) self.configuration.setServerRegIdleCallback(server.register_idle_function) writer = ConnectionWriter(self.readypipein) @@ -443,6 +445,8 @@ class BitBakeServer(object): server.server_timeout = self.configuration.server_timeout server.xmlrpcinterface = self.configuration.xmlrpcinterface print("Started bitbake server pid %d" % os.getpid()) + sys.stdout.flush() + server.start() def connectProcessServer(sockname, featureset): @@ -451,16 +455,15 @@ def connectProcessServer(sockname, featureset): # AF_UNIX has path length issues so chdir here to workaround cwd = os.getcwd() - try: - os.chdir(os.path.dirname(sockname)) - sock.connect(os.path.basename(sockname)) - finally: - os.chdir(cwd) - readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None eq = command_chan_recv = command_chan = None try: + try: + os.chdir(os.path.dirname(sockname)) + sock.connect(os.path.basename(sockname)) + finally: + os.chdir(cwd) # Send an fd for the remote to write events to readfd, writefd = os.pipe() @@ -489,7 +492,8 @@ def connectProcessServer(sockname, featureset): command_chan.close() for i in [writefd, readfd1, writefd2]: try: - os.close(i) + if i: + os.close(i) except OSError: pass sock.close() |