From a0f387467691292fe62c66e56fbc8476c7ecbb2d Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 29 Mar 2006 15:30:34 +0000 Subject: [PATCH] Will die if signal received from a testCmd git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1364 f882894a-f735-0410-b71e-b25c423dba1c --- NPTest.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NPTest.pm b/NPTest.pm index f3fb896a..1372d142 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -609,10 +609,13 @@ sub testCmd { my $object = $class->new; my $output = `$command`; - chomp $output; - - $object->output($output); $object->return_code($? >> 8); + $_ = $? & 127; + if ($_) { + die "Got signal $_ for command $command"; + } + chomp $output; + $object->output($output); if ($ENV{'NPTEST_DEBUG'}) { my ($pkg, $file, $line) = caller(0);