[exim-cvs] Fix exiqsumm output for single queue item.

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Fix exiqsumm output for single queue item.
Gitweb: http://git.exim.org/exim.git/commitdiff/44b2544ecbca17b3903dd56bf499b47063374a13
Commit:     44b2544ecbca17b3903dd56bf499b47063374a13
Parent:     645800e022d5e5a8dfe4fb76f3b11ea4982f1a14
Author:     Todd Lyons <tlyons@???>
AuthorDate: Sat Oct 5 08:31:49 2013 -0700
Committer:  Todd Lyons <tlyons@???>
CommitDate: Sat Oct 5 08:31:49 2013 -0700


    Fix exiqsumm output for single queue item.


    Patch from Richard Hall, with one minor addition to prevent
      uninitialized value error during output.
---
 src/src/exiqsumm.src |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/src/src/exiqsumm.src b/src/src/exiqsumm.src
index 1a200d6..fc5ad26 100644
--- a/src/src/exiqsumm.src
+++ b/src/src/exiqsumm.src
@@ -139,7 +139,7 @@ elsif (/^\s+[^@]*\@([\w\.\-]+|\[(\d+\.){3}\d+\])/o)
print "\nCount Volume Oldest Newest Domain";
print "\n----- ------ ------ ------ ------\n\n";

-my ($count, $volume, $max_age, $min_age) = (0, 0, "0m", "0000d");
+my ($count, $volume, $max_age, $min_age) = (0, 0, "0m", undef);

 foreach $id (sort
             {
@@ -153,10 +153,12 @@ foreach $id (sort
     $queue{$id}, &print_volume_rounded($q_size{$id}), $q_oldest{$id},
     $q_recent{$id}, $id);
     $max_age = $q_oldest{$id} if &older($q_oldest{$id}, $max_age) > 0;
-    $min_age = $q_recent{$id} if &older($min_age, $q_recent{$id}) > 0;
+    $min_age = $q_recent{$id}
+      if (!defined $min_age || &older($min_age, $q_recent{$id}) > 0);
     $volume += $q_size{$id};
     $count += $queue{$id};
   }
+  $min_age ||= "0000d";
 printf("---------------------------------------------------------------\n");
 printf("%5d  %.6s  %6s  %6s  %.80s\n",
   $count, &print_volume_rounded($volume), $max_age, $min_age, "TOTAL");