--- /usr/sbin/tiobench.pl	2005-02-23 00:21:33.000000000 +0100
+++ /home/evil/trash/tiobench_debian	2005-03-15 18:11:19.000000000 +0100
@@ -37,7 +37,7 @@
 # look around for tiotest in different places
 my @tiotest_places=(
    '.',                      # current directory
-   '/usr/sbin',         # install target location
+   '/usr/local/bin',         # install target location
    split(':',$ENV{'PATH'}),  # directories in current $PATH
    ($0 =~m#(.*)/#)           # directory this script resides in
 );
@@ -168,6 +168,8 @@
                   $stat_data{$identifier}{$thread}{$size}{$block}{$field}{'stime'} ) / 
                   $stat_data{$identifier}{$thread}{$size}{$block}{$field}{'time'};
                $stat_data{$identifier}{$thread}{$size}{$block}{$field}{'cpueff'} =
+                  ($stat_data{$identifier}{$thread}{$size}{$block}{$field}{'cpu'} == 0) ?
+                  '0' :
                   ($stat_data{$identifier}{$thread}{$size}{$block}{$field}{'rate'} /
                   ($stat_data{$identifier}{$thread}{$size}{$block}{$field}{'cpu'}/100));
             }
@@ -196,6 +198,9 @@
 $report{'SEQ_WRITES'}   = "Sequential Writes";
 $report{'RAND_WRITES'}  = "Random Writes";
 
+# The top is the same for all 4 reports
+$^ = 'SEQ_READS_TOP';
+
 foreach my $title ('SEQ_READS', 'RAND_READS', 'SEQ_WRITES', 'RAND_WRITES') {
    $-=0; $~="$title"; $^L=''; # reporting variables
    print "\n$report{$title}\n";
