Fixed bug #45619: "--halt" erroneous error exit code.

This commit is contained in:
Ole Tange 2015-07-29 02:33:28 +02:00
parent 95d75a290f
commit 26606a5501
3 changed files with 13 additions and 1 deletions

View file

@ -167,7 +167,8 @@ if($opt::halt and $Global::halt_when ne "never") {
$Global::halt_exitstatus =
::ceil($Global::total_failed / $Global::total_started * 100);
} elsif($Global::halt_count) {
$Global::halt_exitstatus = ::min($Global::total_failed,101);
$Global::halt_exitstatus =
::min(undef_as_zero($Global::total_failed),101);
}
}
wait_and_exit($Global::halt_exitstatus);

View file

@ -17,6 +17,12 @@ export SMALLDISK
) >/dev/null 2>/dev/null
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
echo '### Test bug #45619: "--halt" erroneous error exit code (should give 0)';
seq 10 | parallel --halt now,fail=1 true;
echo $?
echo '**'
echo '### Test exit val - true';
echo true | parallel;
echo $?

View file

@ -1,3 +1,8 @@
echo '### Test bug #45619: "--halt" erroneous error exit code (should give 0)'; seq 10 | parallel --halt now,fail=1 true; echo $?
### Test bug #45619: "--halt" erroneous error exit code (should give 0)
0
echo '**'
**
echo '### Test exit val - true'; echo true | parallel; echo $?
### Test exit val - true
0