[Nagiosplug-checkins] nagiosplug NPTest.pm,1.10,1.11

Ton Voon tonvoon at users.sourceforge.net
Wed Mar 29 07:31:08 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11470

Modified Files:
	NPTest.pm 
Log Message:
Will die if signal received from a testCmd


Index: NPTest.pm
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/NPTest.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- NPTest.pm	23 Mar 2006 17:16:38 -0000	1.10
+++ NPTest.pm	29 Mar 2006 15:30:34 -0000	1.11
@@ -609,10 +609,13 @@
 	my $object = $class->new;
 	
 	my $output = `$command`;
+	$object->return_code($? >> 8);
+	$_ = $? & 127;
+	if ($_) {
+		die "Got signal $_ for command $command";
+	}
 	chomp $output;
-	
 	$object->output($output);
-	$object->return_code($? >> 8);
 
 	if ($ENV{'NPTEST_DEBUG'}) {
 		my ($pkg, $file, $line) = caller(0);





More information about the Commits mailing list