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:
@@ -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
|
||||
-----------------------
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user