projects
/
vuplus_xbmc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4592 from koying/fixlinhotplug
[vuplus_xbmc]
/
xbmc
/
input
/
linux
/
LinuxInputDevices.cpp
diff --git
a/xbmc/input/linux/LinuxInputDevices.cpp
b/xbmc/input/linux/LinuxInputDevices.cpp
index
4b642ae
..
ee21474
100644
(file)
--- 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);
}
//printf("pref: %d\n", m_devicePreferredId);
}
-c
har* CLinuxInputDevice::GetDevic
eName()
+c
onst std::string& CLinuxInputDevice::GetFil
eName()
{
{
- return m_
devic
eName;
+ return m_
fil
eName;
}
bool CLinuxInputDevice::IsUnplugged()
}
bool CLinuxInputDevice::IsUnplugged()
@@
-945,6
+945,11
@@
bool CLinuxInputDevices::CheckDevice(const char *device)
{
int fd;
{
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)
/* 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++)
{
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;
{
ispresent = true;
break;