You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2010/05/31 17:44:52 UTC

svn commit: r949772 - /spamassassin/trunk/spamd/spamd.raw

Author: mmartinec
Date: Mon May 31 15:44:52 2010
New Revision: 949772

URL: http://svn.apache.org/viewvc?rev=949772&view=rev
Log:
Bug 6375: posix macro not implemented in win32 - spamd

Modified:
    spamassassin/trunk/spamd/spamd.raw

Modified: spamassassin/trunk/spamd/spamd.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/spamd/spamd.raw?rev=949772&r1=949771&r2=949772&view=diff
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw (original)
+++ spamassassin/trunk/spamd/spamd.raw Mon May 31 15:44:52 2010
@@ -1019,9 +1019,12 @@ sub spawn {
   $backchannel->setup_backchannel_parent_pre_fork();
 
   # block signal for fork
-  my $sigset = POSIX::SigSet->new( POSIX::SIGINT(), POSIX::SIGCHLD() );
-  sigprocmask( POSIX::SIG_BLOCK(), $sigset )
-    or die "spamd: cannot block SIGINT/SIGCHLD for fork: $!\n";
+  my $sigset;
+  if (!am_running_on_windows()) {
+    $sigset = POSIX::SigSet->new( POSIX::SIGINT(), POSIX::SIGCHLD() );
+    sigprocmask( POSIX::SIG_BLOCK(), $sigset )
+      or die "spamd: cannot block SIGINT/SIGCHLD for fork: $!\n";
+  }    
 
   $pid = fork();
   die "spamd: fork: $!" unless defined $pid;
@@ -1035,8 +1038,10 @@ sub spawn {
     if ($scaling) {
       $scaling->add_child($pid);
     }
-    sigprocmask( POSIX::SIG_UNBLOCK(), $sigset )
-      or die "spamd: cannot unblock SIGINT/SIGCHLD for fork: $!\n";
+    if (!am_running_on_windows()) {
+      sigprocmask( POSIX::SIG_UNBLOCK(), $sigset )
+        or die "spamd: cannot unblock SIGINT/SIGCHLD for fork: $!\n";
+    }
     #Changing to return the process id to improve communications for bug 6304
     return $pid;
   }
@@ -1046,8 +1051,10 @@ sub spawn {
     # Reset signal handling to default settings, and unblock.
     # These lines must be as soon as possible after the fork (bug 4304)
     setup_child_sig_handlers();
-    sigprocmask( POSIX::SIG_UNBLOCK(), $sigset )
-      or die "spamd: cannot unblock SIGINT/SIGCHLD for fork: $!\n";
+    if (!am_running_on_windows()) {
+      sigprocmask( POSIX::SIG_UNBLOCK(), $sigset )
+        or die "spamd: cannot unblock SIGINT/SIGCHLD for fork: $!\n";
+    }
 
     $spamtest->call_plugins("spamd_child_init");