m_fd isn't used anymore
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
const CString TEMP_MOUNT_POINT = "@mctemp/";
|
const CString TEMP_MOUNT_POINT = "@mctemp/";
|
||||||
|
|
||||||
static const char *USB_DEVICE_LIST_FILE = "/proc/bus/usb/devices";
|
|
||||||
static const char *ETC_MTAB = "/etc/mtab";
|
static const char *ETC_MTAB = "/etc/mtab";
|
||||||
|
|
||||||
void GetNewStorageDevices( vector<UsbStorageDevice>& vDevicesOut );
|
void GetNewStorageDevices( vector<UsbStorageDevice>& vDevicesOut );
|
||||||
@@ -128,18 +127,12 @@ static bool ExecuteCommand( CCStringRef sCommand )
|
|||||||
|
|
||||||
MemoryCardDriverThreaded_Linux::MemoryCardDriverThreaded_Linux()
|
MemoryCardDriverThreaded_Linux::MemoryCardDriverThreaded_Linux()
|
||||||
{
|
{
|
||||||
m_fd = open(USB_DEVICE_LIST_FILE, O_RDONLY);
|
|
||||||
if( m_fd == -1 )
|
|
||||||
LOG->Warn( "Failed to open \"%s\": %s", USB_DEVICE_LIST_FILE, strerror(errno) );
|
|
||||||
|
|
||||||
this->StartThread();
|
this->StartThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryCardDriverThreaded_Linux::~MemoryCardDriverThreaded_Linux()
|
MemoryCardDriverThreaded_Linux::~MemoryCardDriverThreaded_Linux()
|
||||||
{
|
{
|
||||||
this->StopThread();
|
this->StopThread();
|
||||||
if( m_fd != -1 )
|
|
||||||
close( m_fd );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryCardDriverThreaded_Linux::ResetUsbStorage()
|
void MemoryCardDriverThreaded_Linux::ResetUsbStorage()
|
||||||
@@ -196,12 +189,6 @@ bool UsbStorageDevicesChanged()
|
|||||||
|
|
||||||
void MemoryCardDriverThreaded_Linux::MountThreadDoOneUpdate()
|
void MemoryCardDriverThreaded_Linux::MountThreadDoOneUpdate()
|
||||||
{
|
{
|
||||||
if( m_fd == -1 )
|
|
||||||
{
|
|
||||||
usleep( 50000 );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool bNeedToDoAnyMounts = false;
|
bool bNeedToDoAnyMounts = false;
|
||||||
for( unsigned i=0; i<m_vDevicesLastSeen.size(); i++ )
|
for( unsigned i=0; i<m_vDevicesLastSeen.size(); i++ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ protected:
|
|||||||
virtual void ResetUsbStorage();
|
virtual void ResetUsbStorage();
|
||||||
virtual void MountThreadDoOneUpdate();
|
virtual void MountThreadDoOneUpdate();
|
||||||
|
|
||||||
int m_fd;
|
|
||||||
vector<UsbStorageDevice> m_vDevicesLastSeen;
|
vector<UsbStorageDevice> m_vDevicesLastSeen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user