Commit 41d201ae authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor fix to error code handling between tbswap/assign_wrapper; an

exitcode of -1 (magic 64 bit is set!) is not a recoverable error since
it typically means someone called die(), and thats an uncontrolled
error.
parent 92986e2f
......@@ -31,6 +31,8 @@ use Getopt::Std;
# 64 - Set to indicate 'recoverability'
# (E.g., no db or physical state was modified
# by the time the error occurred.)
# -1 - An uncontrolled error (someone called die()). No recovery is possible
# so the caller has to check for this explicitly.
#
sub usage ()
{
......
......@@ -625,18 +625,25 @@ sub doSwapin($) {
my $wrapper = (($pid eq "testbed" || $pid eq "tbmeasure") ?
"assign_wrapper-new" : "assign_wrapper");
if ($exitcode = system("$wrapper -u $pid $eid")) {
print STDERR "*** Failed to map to reality.\n";
if (system("$wrapper -u $pid $eid")) {
#
# save this off so it will get passed back later.
# Note that -1 is an uncontrolled error. No recovery.
#
$assignWrapperErrorCode = $exitcode;
if ((($exitcode >> 8) & 64) != 0) {
$assignWrapperErrorCode = $?;
$exitcode = $? >> 8;
print STDERR "*** Failed ($exitcode) to map to reality.\n";
if (($exitcode & 64) && ($exitcode != 255)) {
# so batchexp doesn't choke.
$assignWrapperErrorCode -= 64;
$assignWrapperErrorCode -= 64
if ($exitcode != 255);
# We can recover.
return 7;
} else {
}
else {
# No recovery.
return 1;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment