]> mj.ucw.cz Git - bex.git/commitdiff
bex prun: Fixed priority inversion
authorMartin Mares <mj@ucw.cz>
Sat, 19 Jan 2013 19:17:15 +0000 (20:17 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 19 Jan 2013 19:17:15 +0000 (20:17 +0100)
lib/bin/bex-prun

index 755595ca496e18abb72a9dd73a9fe7193eaea011..0fd8c8768766e3a2d7b280cbee2cdcf209e7e50a 100755 (executable)
@@ -266,7 +266,7 @@ sub place_slot($) {
 
        my $pri = $state_to_pri{$host_state{$s->{'Host'}}};
        my ($best, $besti);
-       my $bestpri = -1;
+       my $bestpri = 99;
        for my $i (0..$nrows-1) {
                my $r = $by_row[$i];
                if (!defined $r) {
@@ -280,7 +280,7 @@ sub place_slot($) {
 
                if ($rpri < $bestpri ||
                    $rpri == $bestpri && $r->{'LastUpdate'} < $best->{'LastUpdate'}) {
-                       # Trick: $best must be defined, as otherwise $bestpri == -1
+                       # Trick: $best must be defined, as otherwise $bestpri == 99
                        $best = $r;
                        $besti = $i;
                        $bestpri = $rpri;