From: dms Date: Wed, 3 Jan 2001 13:42:57 +0000 (+0000) Subject: - topic minor fix. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5faf240f7a1950ec3f85a9a030d3a21c8a50f96c;p=infobot.git - topic minor fix. - POSIX::_exit(0) added: fixes fork problem. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@223 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Misc.pl b/blootbot/src/Misc.pl index a593c3f..3ec5fb5 100644 --- a/blootbot/src/Misc.pl +++ b/blootbot/src/Misc.pl @@ -7,8 +7,10 @@ if (&IsParam("useStrict")) { use strict; } +use POSIX qw(_exit); + sub help { - my $topic = $_[0]; + my $topic = shift; my $file = $bot_misc_dir."/blootbot.help"; my %help = (); @@ -37,7 +39,7 @@ sub help { } close FILE; - if (!defined $topic) { + if (!defined $topic or $topic eq "") { &msg($who, $help{'main'}); my $i = 0; @@ -602,6 +604,7 @@ sub Forker { if (&IsParam("forking") and $$ == $bot_pid) { return $noreply unless (&addForked($label)); + ### use select(undef,undef,undef,0.2); ... $SIG{CHLD} = 'IGNORE'; $pid = eval { fork() }; return $noreply if $pid; # parent does nothing @@ -624,7 +627,7 @@ sub Forker { if (defined $pid) { # child. &delForked($label); &status("fork finished for '$label'."); - exit 0; + POSIX::_exit(0); } }