From 0769f666f8c2db9f290959965be73257e7c33d17 Mon Sep 17 00:00:00 2001 From: dms Date: Thu, 8 Feb 2001 13:57:40 +0000 Subject: [PATCH] possible fix for fork crashing and not detecting a crash from parent. warning included git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@361 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/Shm.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blootbot/src/Shm.pl b/blootbot/src/Shm.pl index 3c50349..6811ff4 100644 --- a/blootbot/src/Shm.pl +++ b/blootbot/src/Shm.pl @@ -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 { -- 2.39.5