INN-2.3.x: old bug in cnfsstat

Mirek Luc mirecki at nask.pl
Mon May 7 14:51:09 UTC 2001



This bug cnfsstat introduced in inn-2.3.
The original cnfsstat from 2.3:
pippin: /tmp/c > ./cnfsstat.old -a -c DEFAULT
Class DEFAULT for groups matching "*"
 Buffer CB4, size:  1.12 GBytes, position:   542 MBytes  10.00 cycles
                                                            ^^
And patched one:
pippin: /tmp/c > ./cnfsstat -a -c DEFAULT
Class DEFAULT for groups matching "*"
 Buffer CB4, size:  1.12 GBytes, position:   542 MBytes  10.47 cycles
                                                            ^^
The Math::BigInt Perl module used by cnfsstat in 2.3 overloads the `/'
operator for bigints and replaces it with division of integers.
The patch below is very simple - it forces Perl's `/'. And it works. :)

-Mirek

<------------------------------------------------------------------------->
*** cnfsstat.old	Mon May  7 15:08:08 2001
--- cnfsstat	Mon May  7 15:08:31 2001
***************
*** 286,292 ****
      $name =~ s/\0//g;
      print " Buffer $name, size: ", &human_readable($len, 4);
      print ", position: ", &human_readable($free, 4);
!     printf("  %.2f cycles\n", $cyclenum + $free/$len);
      my ($when, $ago) = &make_time($update);
      print "  Newest: $when, $ago ago\n";

--- 286,292 ----
      $name =~ s/\0//g;
      print " Buffer $name, size: ", &human_readable($len, 4);
      print ", position: ", &human_readable($free, 4);
!     printf("  %.2f cycles\n", $cyclenum + "$free"/"$len");
      my ($when, $ago) = &make_time($update);
      print "  Newest: $when, $ago ago\n";




More information about the inn-bugs mailing list