You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/06/09 21:58:38 UTC

svn commit: rev 20958 - incubator/spamassassin/trunk/spamd

Author: felicity
Date: Wed Jun  9 12:58:37 2004
New Revision: 20958

Modified:
   incubator/spamassassin/trunk/spamd/spamd.raw
Log:
bug 3490: spamd wasn't warning if the pidfile or socket was failing to be removed during a restart

Modified: incubator/spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- incubator/spamassassin/trunk/spamd/spamd.raw	(original)
+++ incubator/spamassassin/trunk/spamd/spamd.raw	Wed Jun  9 12:58:37 2004
@@ -771,7 +771,9 @@
   sleep;    # wait for a signal (ie: child's death)
 
   if ( defined $got_sighup ) {
-    defined( $opt{'pidfile'} ) and unlink( $opt{'pidfile'} );
+    if (defined($opt{'pidfile'})) {
+      unlink($opt{'pidfile'}) || warn "Can't unlink $opt{'pidfile'}: $!\n";
+    }
 
     # leave Client fds active, and do not kill children; they can still
     # service clients until they exit.  But restart the listener anyway.
@@ -1672,10 +1674,14 @@
   logmsg("server killed by SIG$sig, shutting down");
   $server->close;
 
-  defined( $opt{'pidfile'} ) and unlink( $opt{'pidfile'} );
+  if (defined($opt{'pidfile'})) {
+    unlink($opt{'pidfile'}) || warn "Can't unlink $opt{'pidfile'}: $!\n";
+  }
 
   # the UNIX domain socket
-  defined( $opt{'socketpath'} ) and unlink( $opt{'socketpath'} );
+  if (defined($opt{'socketpath'})) {
+    unlink($opt{'socketpath'}) || warn "Can't unlink $opt{'socketpath'}: $!\n";
+  }
 
   $SIG{CHLD} = 'DEFAULT';    # we're going to kill our children
   kill 'INT' => keys %children;
@@ -1708,7 +1714,9 @@
     $server->close;
 
     # the UNIX domain socket
-    defined( $opt{'socketpath'} ) and unlink( $opt{'socketpath'} );
+    if (defined($opt{'socketpath'})) {
+      unlink($opt{'socketpath'}) || warn "Can't unlink $opt{'socketpath'}: $!\n";
+    }
 
     warn "server socket closed\n" if $opt{'debug'};
   }