]> git.donarmstrong.com Git - infobot.git/commitdiff
- support extra crap added to shm value.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Aug 2003 11:29:30 +0000 (11:29 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Aug 2003 11:29:30 +0000 (11:29 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@813 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Schedulers.pl

index 44b021feb625be3b52b2c6d988217720f7deca9d..3fe5e63a3e54c9a00d44a8f4790259ec75660f6d 100644 (file)
@@ -765,11 +765,14 @@ sub miscCheck {
        my ($shmid, $size) = ($2,$5);
        next unless ($shmid != $shm and $size == 2000);
        my $z   = &shmRead($shmid);
-       # TODO - add nick to SHM so multiple instances can be running
-       # as the same unix user on the same host?
-       if ($z =~ /^(\d+): /) {
-           my $time    = $1;
+       if ($z =~ /^(\S+):(\d+):(\d+): /) {
+           my $n       = $1;
+           my $pid     = $2;
+           my $time    = $3;
            next if (time() - $time < 60*60);
+           next if ($pid == $bot_pid);
+           # don't touch other bots, if they're running.
+           next unless ($param{ircNick} =~ /^\Q$n\E$/);
        } else {
 #          &DEBUG("shm: $shmid is not ours or old blootbot => ($z)");
 #          next;