summaryrefslogtreecommitdiff
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
parent23c1e284ea748942e7067454aae2b279a1ab0e68 (diff)
downloadbuildstream-98-ctrl-c-doesn-t-properly-kill-a-non-interactive-shell.tar.gz
artifactcache.py: Fix missing fetch_remote_refs interface98-ctrl-c-doesn-t-properly-kill-a-non-interactive-shell
-rw-r--r--buildstream/_artifactcache/artifactcache.py3
-rw-r--r--buildstream/sandbox/_sandboxbwrap.py7
-rw-r--r--buildstream/sandbox/_sandboxchroot.py7
3 files changed, 15 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py
index fc59c48a4..246a7691d 100644
--- a/buildstream/_artifactcache/artifactcache.py
+++ b/buildstream/_artifactcache/artifactcache.py
@@ -168,3 +168,6 @@ class ArtifactCache():
#
def remote_contains(self, element, strength=None):
return False
+
+ def fetch_remote_refs(self):
+ pass
diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py
index df72eead7..d0b1c5171 100644
--- a/buildstream/sandbox/_sandboxbwrap.py
+++ b/buildstream/sandbox/_sandboxbwrap.py
@@ -304,7 +304,12 @@ class SandboxBwrap(Sandbox):
except psutil.NoSuchProcess:
pass
- exit_code = process.poll()
+ # Return the exit code - see the documentation for
+ # os.WEXITSTATUS to see why this is required.
+ if os.WIFEXITED(status):
+ exit_code = os.WEXITSTATUS(status)
+ else:
+ exit_code = -1
if interactive and stdin.isatty():
# Make this process the foreground process again, otherwise the
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