summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-01-13 17:01:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-15 10:06:21 +0000
commitecdfc1ebbe260fc7b2842b751d913580d294cb42 (patch)
tree6b5969f32ff057f580b39c537f85ae0fa930bd63 /bitbake
parent4e8085ccfa38f491edb7566a3d02795b8b5e6f73 (diff)
downloadast2050-yocto-poky-ecdfc1ebbe260fc7b2842b751d913580d294cb42.zip
ast2050-yocto-poky-ecdfc1ebbe260fc7b2842b751d913580d294cb42.tar.gz
bitbake/fetch2: correctly decode exit signal/status
The termination signal and exit code of the fetch process were not being decoded correctly, resulting in bitbake reporting that the process terminated with a signal of the exit code (if it was under 255). There are functions in the Python os module to do this decoding correctly (for Unix at least), so let's use them. (Bitbake rev: 50aea9a76e40cf71cc3f1462c88298e4846a031c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 21abb13..771f72e 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -422,8 +422,11 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
output += line
status = stdout_handle.close() or 0
- signal = status >> 8
- exitstatus = status & 0xff
+ signal = os.WTERMSIG(status)
+ if os.WIFEXITED(status):
+ exitstatus = os.WEXITSTATUS(status)
+ else:
+ exitstatus = 0
if (signal or status != 0):
for f in cleanup:
@@ -434,8 +437,8 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
if signal:
raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output))
- elif status != 0:
- raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output))
+ elif exitstatus:
+ raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, exitstatus, output))
return output
OpenPOWER on IntegriCloud