summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-01-24 19:59:42 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-01-24 19:59:42 +0000
commite7ff99d1cc0e926bc72a007dca62fd083aef3c4a (patch)
tree2c704f9e75e3804f62348a5e132654820adbb227
parent789f6481b53542ff939c2dd7746dd702541089a0 (diff)
A better test for the Astribank transport directory
* On some kernels there's no 'usb_endpoint' under the USB device's SysFS node. Use 'idVendor' which is far less likely to fail. * Actively resolve the symlink 'transport' to its name (e.g. '1-2'). Originally r7825 from the branch perl-sysstate. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@7954 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--xpp/perl_modules/Dahdi/Hardware/USB.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/xpp/perl_modules/Dahdi/Hardware/USB.pm b/xpp/perl_modules/Dahdi/Hardware/USB.pm
index dff25ef..8b84243 100644
--- a/xpp/perl_modules/Dahdi/Hardware/USB.pm
+++ b/xpp/perl_modules/Dahdi/Hardware/USB.pm
@@ -93,8 +93,9 @@ sub set_transport($$) {
} else {
warn "Bad USB transportdir='$transportdir' usbdev='$usbdev'\n";
}
- } elsif(-d "$transportdir/usb_endpoint") {
- $transportdir =~ m|/(\d+)-\d+$|;
+ } elsif(-f "$transportdir/idVendor" ) {
+ my $transport_link = readlink($transportdir);
+ $transport_link =~ m|/(\d+)-\d+$|;
$busnum = $1;
$devnum = readval("$transportdir/devnum");
}