From 249ab61b9d1b697f20db0a4adac6b7769f9b4312 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 29 Jan 2009 14:31:40 -0800 Subject: Fix exists/not exists function The operator precendence in perl is not same as C. --- scripts/vyatta_quagga_utils.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/vyatta_quagga_utils.pl b/scripts/vyatta_quagga_utils.pl index c0087ea6..b6fe5ce2 100755 --- a/scripts/vyatta_quagga_utils.pl +++ b/scripts/vyatta_quagga_utils.pl @@ -33,14 +33,16 @@ sub check_exists { my $node = shift; my $config = new Vyatta::Config; - exit $config->exists($node) ? 0 : 1; + exit 0 if $config->exists($node); + exit 1; } sub check_not_exists { my $node = shift; my $config = new Vyatta::Config; - exit $config->exists($node) ? 1 : 0; + exit 0 if ! $config->exists($node); + exit 1; } sub check_ospf_area { -- cgit v1.2.3