]> git.donarmstrong.com Git - infobot.git/commitdiff
- topic minor fix.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 3 Jan 2001 13:42:57 +0000 (13:42 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 3 Jan 2001 13:42:57 +0000 (13:42 +0000)
- POSIX::_exit(0) added: fixes fork problem.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@223 c11ca15a-4712-0410-83d8-924469b57eb5

src/Misc.pl

index a593c3fbdaf9fe8eacff4cd1c89e5e40c4e9a7f2..3ec5fb5eaf26df2d36bf38120b7c55d16f6e7264 100644 (file)
@@ -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);
     }
 }