dahdi_perl: fix regression with an AB with no modules

Fixes a regression introduced in
3572bb5a13 (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 <tzafrir.cohen@xorcom.com>
This commit is contained in:
Tzafrir Cohen 2013-12-30 15:09:28 +02:00
parent de1ee8494a
commit b8d1e467e4

View File

@ -110,9 +110,7 @@ sub read_xpdnames($) {
sub read_num($) { sub read_num($) {
my $self = shift or die; my $self = shift or die;
my $xbus_dir = $self->sysfs_dir; my $xbus_dir = $self->sysfs_dir;
my @xpdnames = read_xpdnames($xbus_dir); $xbus_dir =~ /.*-(\d\d)$/;
my $first = shift @xpdnames or die "No XPDs for '$xbus_dir'\n";
$first =~ /^(\d+\d+).*/;
return $1; return $1;
} }