summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-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 21abb13b19..771f72e4ae 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 = []):
422 output += line 422 output += line
423 423
424 status = stdout_handle.close() or 0 424 status = stdout_handle.close() or 0
425 signal = status >> 8 425 signal = os.WTERMSIG(status)
426 exitstatus = status & 0xff 426 if os.WIFEXITED(status):
427 exitstatus = os.WEXITSTATUS(status)
428 else:
429 exitstatus = 0
427 430
428 if (signal or status != 0): 431 if (signal or status != 0):
429 for f in cleanup: 432 for f in cleanup:
@@ -434,8 +437,8 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
434 437
435 if signal: 438 if signal:
436 raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output)) 439 raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output))
437 elif status != 0: 440 elif exitstatus:
438 raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output)) 441 raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, exitstatus, output))
439 442
440 return output 443 return output
441 444