From 1296cd775dd5291cd5a29214de6a387a75e8d534 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 28 Jun 2004 05:23:55 +0000 Subject: [PATCH] add port detection through lsusb --- .../MemoryCardDriverThreaded_Linux.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index f13e5fd712..8e4c2d0344 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -406,11 +406,14 @@ void GetNewStorageDevices( vector& vDevicesOut ) { // Bus 002 Device 001: ID 0000:0000 + // Port 4 // iSerial 3 1125198948886 // bInterfaceClass 8 Mass Storage - CString sCommand = "/usr/sbin/lsusb"; - char *szParams[] = { "/usr/sbin/lsusb", "-v", NULL }; + // Don't include a path. The usbutils installer script installs + // to /usr/local/sbin and the Debian package installs to /usr/sbin/. + CString sCommand = "lsusb"; + char *szParams[] = { "lsusb", "-v", NULL }; CString sOutput; RunProgram( sCommand, szParams, sOutput ); @@ -432,7 +435,16 @@ void GetNewStorageDevices( vector& vDevicesOut ) usbd.iBus = iBus; continue; // stop processing this line } - + + // Port 4 + int iPort; + iRet = sscanf( sLine.c_str(), "Port %d", &iPort ); + if( iRet == 1 ) + { + usbd.iPort = iPort; + continue; // stop processing this line + } + // iSerial 3 1125198948886 char szSerial[1024]; iRet = sscanf( sLine.c_str(), " iSerial %d %[^\n]", &iThrowAway, szSerial );