From b8d1e467e4ce5a8bb883ab8f7be0095f708f772e Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 30 Dec 2013 15:09:28 +0200 Subject: [PATCH] dahdi_perl: fix regression with an AB with no modules Fixes a regression introduced in 3572bb5a137e1fef85e30805c6811ae74a619b2a (before 2.7.0) - most of the dahdi_perl tools will fail for an Astribank with no modules claiming "No XPDs for '/sys/bus/astribanks/devices/xbus-00'" Signed-off-by: Tzafrir Cohen --- xpp/perl_modules/Dahdi/Xpp/Xbus.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xpp/perl_modules/Dahdi/Xpp/Xbus.pm b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm index a6e07e5..d916066 100644 --- a/xpp/perl_modules/Dahdi/Xpp/Xbus.pm +++ b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm @@ -110,9 +110,7 @@ sub read_xpdnames($) { sub read_num($) { my $self = shift or die; my $xbus_dir = $self->sysfs_dir; - my @xpdnames = read_xpdnames($xbus_dir); - my $first = shift @xpdnames or die "No XPDs for '$xbus_dir'\n"; - $first =~ /^(\d+\d+).*/; + $xbus_dir =~ /.*-(\d\d)$/; return $1; }