1
0
mirror of synced 2026-04-14 23:37:56 +00:00

Save exit code $? at the beginning of the END block

Otherwise cleaning up by doing some system() calls garbles $? with
unwanted values.
This commit is contained in:
Axel Beckert
2013-01-25 13:19:36 +01:00
parent d3baf1f8ba
commit 0709308c1f
2 changed files with 7 additions and 3 deletions

View File

@@ -4,8 +4,7 @@ KNOWN BUGS in xen-tools
Bugs to fix before next release
-------------------------------
* Exit code of a failed xen-create-image run seems still to be 0, at
least in some cases.
[None so far]
Bugs to fix rather soon
-----------------------

View File

@@ -4094,7 +4094,10 @@ sub clean_up () {
END
{
exit 0 if $VERSION || $HELP || $MANUAL || $DUMPCONFIG;
# Capture exit code
my $exitcode = $?;
exit $exitcode if $VERSION || $HELP || $MANUAL || $DUMPCONFIG;
my $host_rsa_key = '';
#
@@ -4234,4 +4237,6 @@ END
}
logprint("\n");
}
exit $exitcode;
}