packages: nagios-ocpd/ocpd.pl - use known exit code
glen
glen at pld-linux.org
Tue Jun 26 10:57:09 CEST 2012
Author: glen Date: Tue Jun 26 08:57:09 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- use known exit code
---- Files affected:
packages/nagios-ocpd:
ocpd.pl (1.2 -> 1.3)
---- Diffs:
================================================================
Index: packages/nagios-ocpd/ocpd.pl
diff -u packages/nagios-ocpd/ocpd.pl:1.2 packages/nagios-ocpd/ocpd.pl:1.3
--- packages/nagios-ocpd/ocpd.pl:1.2 Tue Jun 26 10:52:46 2012
+++ packages/nagios-ocpd/ocpd.pl Tue Jun 26 10:57:04 2012
@@ -102,7 +102,10 @@
my @queue;
my $log_fh;
if ($log_file) {
- open($log_fh, '>', $log_file) or die ("Can't write: $log_file");
+ unless (open($log_fh, '>', $log_file)) {
+ print "Can't write: $log_file\n";
+ exit 1;
+ }
}
## VERY IMPORTANT: You have to open the pipe in O_RDWR, POSIX has rules about
@@ -141,7 +144,7 @@
open(NSCA, "|$nsca >/dev/null 2>/dev/null") or die "Failed to spawn send_nsca: $!";
print NSCA @queue;
close(NSCA);
- print $log_fh @queue if $log_fh;
+ print $log_fh @queue if $log_fh;
exit;
} elsif (!defined ($fork)) {
================================================================
---- CVS-web:
http://cvs.pld-linux.org/packages/nagios-ocpd/ocpd.pl?r1=1.2&r2=1.3
More information about the pld-cvs-commit
mailing list