From 90c2b6cb24dc9c82f0a9aa9d23f2d1ed2e6ff301 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Sep 2010 11:14:54 -0700 Subject: [PATCH] Fix exit code display for task failure Per the python documentation, os.waitpid returns the exitcode shifted up by 8 bits, and we weren't compensating, resulting in a display of 'failed with 256' when a worker process exits with a code of 1. Signed-off-by: Chris Larson --- lib/bb/runqueue.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 8c99c33f35d..aa9a5f720a9 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -949,7 +949,8 @@ class RunQueue: Called when a task has failed Updates the state engine with the failure """ - logger.error("Task %s (%s) failed with %s", task, self.get_user_idstring(task), exitcode) + logger.error("Task %s (%s) failed with exit code '%s'", task, + self.get_user_idstring(task), exitcode) self.stats.taskFailed() fnid = self.runq_fnid[task] self.failed_fnids.append(fnid) @@ -1023,7 +1024,7 @@ class RunQueue: self.build_pipes[result[0]].close() del self.build_pipes[result[0]] if result[1] != 0: - failure(task, result[1]) + failure(task, result[1]>>8) else: success(task) self.stats.taskCompleted() -- 2.47.3