]> git.donarmstrong.com Git - infobot.git/blobdiff - blootbot/src/Shm.pl
...
[infobot.git] / blootbot / src / Shm.pl
index 136bd165b26544daa7a22725c4f37b69af5c8701..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 {
@@ -154,6 +161,10 @@ sub delForked {
        POSIX::_exit(0);
     }
 
+    if ($name =~ /\.pl/) {
+       &WARN("dF: name is name of source file ($name). FIX IT!");
+    }
+
     &showProc();       # just for informational purposes.
 
     if (exists $forked{$name}) {