summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-05-26 08:09:26 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-05-26 08:11:31 (GMT)
commit9880a949d2f1e1783302f4f6e25a4729d8761d5e (patch) (side-by-side diff)
tree987860172e766d2c43ec42086ff4a76f0a461e80
parentf12defd06dfab84dd5a6a1d6f9839d6bb3af2c62 (diff)
downloadconfig-haproxy-9880a949d2f1e1783302f4f6e25a4729d8761d5e.tar.gz
config-haproxy-9880a949d2f1e1783302f4f6e25a4729d8761d5e.tar.bz2
Fix improper use of IPC::Cmd->run
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--lib/Config/HAProxy.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Config/HAProxy.pm b/lib/Config/HAProxy.pm
index 794a80f..44cc3fb 100644
--- a/lib/Config/HAProxy.pm
+++ b/lib/Config/HAProxy.pm
@@ -13,10 +13,10 @@ use File::Basename;
use File::Temp qw(tempfile);
use File::stat;
use File::Spec;
-use IPC::Cmd;
+use IPC::Cmd qw(run);
use Carp;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
my %sections = (
global => 1,
@@ -231,12 +231,14 @@ sub save {
DIR => dirname($self->filename));
$self->write($fh, @wrargs);
close($fh);
-
if (my $cmd = $self->lint) {
- my ($ok, $err, undef, undef, $errbuf) =
- IPC::Cmd->run(command => "$cmd $tempfile");
+ my ($ok, $err, $full, $outbuf, $errbuf) =
+ run(command => "$cmd $tempfile");
unless ($ok) {
- croak "Syntax check failed: $errbuf\n";
+ if ($errbuf && @$errbuf) {
+ croak "Syntax check failed: ".join("\n", @$errbuf)."\n";
+ }
+ croak $err;
}
}
return 1 if $dry_run;

Return to:

Send suggestions and report system problems to the System administrator.