[svn-commits] tzafrir: tools/trunk r7954 - /tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jan 24 13:59:46 CST 2010


Author: tzafrir
Date: Sun Jan 24 13:59:42 2010
New Revision: 7954

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7954
Log:
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.

Modified:
    tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm

Modified: tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm?view=diff&rev=7954&r1=7953&r2=7954
==============================================================================
--- tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm (original)
+++ tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm Sun Jan 24 13:59:42 2010
@@ -93,8 +93,9 @@
 		} 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");
 	}




More information about the svn-commits mailing list