X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=xbmc%2Finput%2Flinux%2FLinuxInputDevices.cpp;h=ee21474288c988136084a20f7aa766a93d2d4529;hb=37181cb6192dbc9b0051ee684890000df3a7f1e9;hp=4b642ae7e6fd989688465b23424347054d1edd0b;hpb=a58bcbb0a35ac8e26a880be477705d833330ecc5;p=vuplus_xbmc diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp index 4b642ae..ee21474 100644 --- a/xbmc/input/linux/LinuxInputDevices.cpp +++ b/xbmc/input/linux/LinuxInputDevices.cpp @@ -931,9 +931,9 @@ void CLinuxInputDevice::GetInfo(int fd) //printf("pref: %d\n", m_devicePreferredId); } -char* CLinuxInputDevice::GetDeviceName() +const std::string& CLinuxInputDevice::GetFileName() { - return m_deviceName; + return m_fileName; } bool CLinuxInputDevice::IsUnplugged() @@ -945,6 +945,11 @@ bool CLinuxInputDevices::CheckDevice(const char *device) { int fd; + // Does the device exists? + struct stat buffer; + if (stat(device, &buffer) != 0) + return false; + /* Check if we are able to open the device */ fd = open(device, O_RDWR); if (fd < 0) @@ -1016,7 +1021,7 @@ void CLinuxInputDevices::CheckHotplugged() for (size_t j = 0; j < m_devices.size(); j++) { - if (strcmp(m_devices[j]->GetDeviceName(),buf) == 0) + if (m_devices[j]->GetFileName().compare(buf) == 0) { ispresent = true; break;