]> git.donarmstrong.com Git - infobot.git/commitdiff
possible fix for fork crashing and not detecting a crash from parent. warning included
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 8 Feb 2001 13:57:40 +0000 (13:57 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 8 Feb 2001 13:57:40 +0000 (13:57 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@361 c11ca15a-4712-0410-83d8-924469b57eb5

src/Shm.pl

index 3c5034913133dc49d4714b381d9cbb981729e9b2..6811ff458e26a91a8ef491eb258aaf1819e8385d 100644 (file)
@@ -117,10 +117,17 @@ sub addForked {
        $count++;
     }
 
-    if (exists $forked{$name}) {
+    if (exists $forked{$name} and !scalar keys %{ $forked{$name} }) {
+       &WARN("addF: forked{$name} exists but is empty; deleting.");
+       undef $forked{$name};
+    }
+
+    if (exists $forked{$name} and scalar keys %{ $forked{$name} }) {
        my $time        = $forked{$name}{Time};
        my $continue    = 0;
 
+       &DEBUG("PID => $forked{$name}{PID}");
+
        if (-d "/proc/$forked{$name}{PID}") {
            &status("fork: still running; good. BAIL OUT.");
        } else {