sub StartErrorGuardian { my ($this, $pm) = @_; $this->Log("INFO","CWAPP: Starting error guardian\n"); $continue_flag = 1; if ($this->{bThreadStarted} == 0) { $this->{bThreadStarted} = 1; my $pid= fork(); if (not defined $pid) { $this->Log("ERROR","CWAPP: Could not start error guardian\n"); return 0; } if ($pid == 0) { $this->Guardian(); } else { return $pid; } } return 0; }