spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r377095 - /spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm
Date Sun, 12 Feb 2006 00:18:09 GMT
Author: jm
Date: Sat Feb 11 16:18:07 2006
New Revision: 377095

URL: http://svn.apache.org/viewcvs?rev=377095&view=rev
Log:
trivial: avoid a silly-but-harmless 'Use of uninitialized value in numeric eq (==)' warning

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm?rev=377095&r1=377094&r2=377095&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm Sat Feb 11 16:18:07 2006
@@ -652,6 +652,14 @@
 
   foreach my $pid (@pids) {
     my $k = $kids->{$pid};
+
+    # note: race condition here.  if a child exits between the keys() call
+    # above, and this point, then $k will be undef here due to its deletion
+    # from the hash in the SIGCHLD handler.  This is harmless, but ugly, since
+    # it produces a 'Use of uninitialized value in numeric eq (==)' warning at
+    # the "== PFSTATE_IDLE" line below.
+    next unless defined $k;
+
     if ($k == PFSTATE_IDLE) {
       $statestr .= 'I';
       $num_idle++;



Mime
View raw message