From 8b38b6aae2f292339e1be04239361fba71c00774 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 4 Sep 2016 16:42:26 +0300 Subject: [PATCH] runVM: check exit code before postVM eval --- pkgs/build-support/vm/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 5b407f530dc8..81a9f89dd100 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -261,9 +261,12 @@ rec { exit 1 fi - eval "$postVM" + exitCode="$(cat xchg/in-vm-exit)" + if [ "$exitCode" != "0" ]; then + exit "$exitCode" + fi - exit $(cat xchg/in-vm-exit) + eval "$postVM" '';