Mailing List Archive

svn commit: rev 6748 - incubator/spamassassin/trunk/spamd
Author: mss
Date: Wed Feb 18 17:56:39 2004
New Revision: 6748

Modified:
incubator/spamassassin/trunk/spamd/spamd.raw
Log:
Make the syslog-SIGPIPE-handler more local and make sure its always removed again (to avoid it being called if pipes to helper apps break).


Modified: incubator/spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- incubator/spamassassin/trunk/spamd/spamd.raw (original)
+++ incubator/spamassassin/trunk/spamd/spamd.raw Wed Feb 18 17:56:39 2004
@@ -1355,11 +1355,6 @@

sub logmsg
{
- # install a new handler for SIGPIPE -- this signal has been
- # found to occur with syslog-ng after syslog-ng restarts.
- my $orig_sigpipe_handler = $SIG{'PIPE'};
- $SIG{'PIPE'} = sub { $main::SIGPIPE_RECEIVED++; };
-
my $msg = join(" ", @_);
$msg =~ s/[\r\n]+$//; # remove any trailing newlines
$msg =~ s/[[:cntrl:]]/_/g; # replace all other control chars with underscores
@@ -1387,6 +1382,10 @@
}
# log to syslog (if logging isn't disabled completely via 'null')
elsif ($log_socket ne 'none') {
+ # install a new handler for SIGPIPE -- this signal has been
+ # found to occur with syslog-ng after syslog-ng restarts.
+ local $SIG{'PIPE'} = sub { $main::SIGPIPE_RECEIVED++ };
+
openlog('spamd', 'cons,pid', $log_facility);

eval { syslog('info', "%s", $msg); };
@@ -1418,8 +1417,6 @@
}
}
}
-
- $SIG{'PIPE'} = $orig_sigpipe_handler if defined($orig_sigpipe_handler);
}

sub kill_handler