summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/_sandboxchroot.py
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-10-12 17:03:49 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2017-10-19 14:04:00 +0100
commit0f7e5df53612bb04a92631a34014bb7dae3195fd (patch)
tree8e1c29792717b3565708f2256024adf0271b32e1 /buildstream/sandbox/_sandboxchroot.py
parent23c1e284ea748942e7067454aae2b279a1ab0e68 (diff)
downloadbuildstream-0f7e5df53612bb04a92631a34014bb7dae3195fd.tar.gz
artifactcache.py: Fix missing fetch_remote_refs interface98-ctrl-c-doesn-t-properly-kill-a-non-interactive-shell
Diffstat (limited to 'buildstream/sandbox/_sandboxchroot.py')
-rw-r--r--buildstream/sandbox/_sandboxchroot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/buildstream/sandbox/_sandboxchroot.py b/buildstream/sandbox/_sandboxchroot.py
index 5aca493dd..de3220c22 100644
--- a/buildstream/sandbox/_sandboxchroot.py
+++ b/buildstream/sandbox/_sandboxchroot.py
@@ -172,7 +172,12 @@ class SandboxChroot(Sandbox):
except psutil.NoSuchProcess:
pass
- code = process.poll()
+ # Return the exit code - see the documentation for
+ # os.WEXITSTATUS to see why this is required.
+ if os.WIFEXITED(status):
+ code = os.WEXITSTATUS(status)
+ else:
+ code = -1
except subprocess.SubprocessError as e:
# Exceptions in preexec_fn are simply reported as