diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-07-10 15:11:14 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-07-10 15:18:04 +0000 |
commit | c9217545ee194839da63264a0ed9aeebc7481f9b (patch) | |
tree | b89d374a3d36cdaee6dada36dcc76c2825ef6059 | |
parent | 8fc222328d3c409972aecc8a66330683e00d1b35 (diff) |
docker-run.sh: Ignore container cleanup failures and preserve exit code
Change-Id: I40f12ea1c90ecfc62a33de702121ec238f5e854d
-rwxr-xr-x | docker-run.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docker-run.sh b/docker-run.sh index c626de11..b021b9bf 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -16,9 +16,10 @@ case "$qemu" in *) "$(dirname $0)"/start-container-qemu.sh "${CONVERTED_ARGS[@]:1}" > container.sh ;; esac -# Where prefix is something like "run_" or "test_" -# shellcheck disable=SC2064 -trap "${prefix}container_cleanup" EXIT +# Where prefix is something like "run_" or "test_". +# We ignore cleanup failures and exit with the original status code. +# shellcheck disable=SC2064 disable=SC2154 +trap "res=\$?; ${prefix}container_cleanup & wait \$! || true; exit \$res" EXIT . ./container.sh # We want to use flock only when WORKSPACE exists |