git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@533
c11ca15a-4712-0410-83d8-
924469b57eb5
### TODO: use &time2string()?
&WARN("Fork: looks like we lost '$_', executed $time ago");
### TODO: use &time2string()?
&WARN("Fork: looks like we lost '$_', executed $time ago");
- if ( -d "/proc/$forked{$name}{PID}") {
- my $pid = $forked{$name}{PID};
+ my $pid = $forked{$name}{PID};
+ # don't kill parent!
+ if ($pid == $$) {
+ &status("Fork: pid == \$\$ ($$)");
+ next;
+ }
+
+ if ( -d "/proc/$pid") {
&status("Fork: killing $name ($pid)");
kill 9, $pid;
}
&status("Fork: killing $name ($pid)");
kill 9, $pid;
}