On Wed Aug 25 21:45:16 2010, MSCHILLI wrote:
Show quoted text> It'd be easy to add a check/logic for that, but I wonder if there's a
> cookbook recipe for handling multiple sig handlers in a cooperative way?
I've done some inquiries and it appears that the only systems for
sharing signals like this are in big frameworks like AnyEvent or POE --
there is nothing if one doesn't make a lot of assumptions about the
environment Log::Log4perl is running in.
I'll keep looking around, but in the meantime I think the best we can do
is simply accommodate the cases where the signal handler is a string..
this is at least better than wiping out whatever handler(s) were there
before.
commit 12b902f163f8cad9ed869934d4282b8be62232e8
Author: Karen Etheridge <ether@cpan.org>
Date: Fri Aug 27 11:46:31 2010 -0700
don't attempt to call an old signal handler if it is a string like
"IGNORE" or "DEFAULT".
diff --git a/lib/Log/Log4perl/Config/Watch.pm
b/lib/Log/Log4perl/Config/Watch.pm
index d8115e3..6ebb51f 100644
--- a/lib/Log/Log4perl/Config/Watch.pm
+++ b/lib/Log/Log4perl/Config/Watch.pm
@@ -35,7 +35,7 @@ sub new {
$SIG{$self->{signal}} = sub {
print "Caught $self->{signal} signal\n" if _INTERNAL_DEBUG;
$self->force_next_check();
- $old_sig_handler->(@_) if $old_sig_handler;
+ $old_sig_handler->(@_) if $old_sig_handler and ref
$old_sig_handler eq 'CODE';
};
# Reset the marker. The handler is going to modify it.
$self->{signal_caught} = 0;