From: Yukimasa TAKANO Date: Wed, 19 Dec 2007 21:19:43 +0000 (+1300) Subject: child handler overwritten at send message X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=660977c24872a859139bb0a18b0475be40f27b1b;p=spong.git child handler overwritten at send message Some child process call message_user() with SIG{CHLD} = 'IGNORE', but overwrite to chld_handler() at finish sending message. That is wrong. This patch allows to keep SIG{CHLD} to 'IGNORE' after sending message. --- diff --git a/src/spong-server.pl b/src/spong-server.pl index 0f97779..e832e2d 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -1207,6 +1207,7 @@ sub message_user { if (! defined $duration || $duration eq "") { $duration = 0; } + my $child_handler = $SIG{'CHLD'}; $SIG{'CHLD'} = 'IGNORE'; # if message type was 'status' and messaging is allowed @@ -1266,7 +1267,7 @@ sub message_user { $message, 1 ); } - $SIG{'CHLD'} = \&chld_handler; + $SIG{'CHLD'} = $child_handler; } # This func takes care of sending out the notification message by calling