summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py33
1 files changed, 22 insertions, 11 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b870caff4e..8828e4af6b 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1046,18 +1046,29 @@ class RunQueueExecute:
1046 Return none is there are no processes awaiting result collection, otherwise 1046 Return none is there are no processes awaiting result collection, otherwise
1047 collect the process exit codes and close the information pipe. 1047 collect the process exit codes and close the information pipe.
1048 """ 1048 """
1049 result = os.waitpid(-1, os.WNOHANG) 1049 pid, status = os.waitpid(-1, os.WNOHANG)
1050 if result[0] == 0 and result[1] == 0: 1050 if pid == 0 or os.WIFSTOPPED(status):
1051 return None 1051 return None
1052 task = self.build_pids[result[0]] 1052
1053 del self.build_pids[result[0]] 1053 if os.WIFEXITED(status):
1054 self.build_pipes[result[0]].close() 1054 status = os.WEXITSTATUS(status)
1055 del self.build_pipes[result[0]] 1055 elif os.WIFSIGNALED(status):
1056 # self.build_stamps[result[0]] may not exist when use shared work directory. 1056 # Per shell conventions for $?, when a process exits due to
1057 if result[0] in self.build_stamps.keys(): 1057 # a signal, we return an exit code of 128 + SIGNUM
1058 del self.build_stamps[result[0]] 1058 status = 128 + os.WTERMSIG(status)
1059 if result[1] != 0: 1059
1060 self.task_fail(task, result[1]>>8) 1060 task = self.build_pids[pid]
1061 del self.build_pids[pid]
1062
1063 self.build_pipes[pid].close()
1064 del self.build_pipes[pid]
1065
1066 # self.build_stamps[pid] may not exist when use shared work directory.
1067 if pid in self.build_stamps.keys():
1068 del self.build_stamps[pid]
1069
1070 if status != 0:
1071 self.task_fail(task, status)
1061 else: 1072 else:
1062 self.task_complete(task) 1073 self.task_complete(task)
1063 return True 1074 return True