Ticket #35261: patch-src-common-port-hid_port.cpp.diff

File patch-src-common-port-hid_port.cpp.diff, 851 bytes (added by alexgrach, 12 years ago)
  • hid_port.cpp

    old new  
    1414#  include <sys/stat.h>
    1515#  include <sys/ioctl.h>
    1616#  include <fcntl.h>
    17 #  include <linux/hiddev.h>
     17//#  include <linux/hiddev.h>
    1818#  include <errno.h>
    1919#  include <unistd.h>
    2020#endif
     
    3838
    3939bool Port::HID::getDeviceIds(uint index, uint& vendorId, uint& productId)
    4040{
    41 #ifdef Q_OS_UNIX
    42   const QString path = devicePath(index);
    43   const int fd = ::open(path.latin1(), O_RDONLY);
    44   if (fd < 0) {
    45      return false;
    46   }
    47   hiddev_devinfo info;
    48   const bool ok = (ioctl(fd, HIDIOCGDEVINFO, &info) >= 0);
    49   if (ok) {
    50     vendorId = info.vendor;
    51     productId = info.product;
    52   }
    53   ::close(fd);
    54   return ok;
    55 #else
    5641  return false;
    57 #endif
    5842}
    5943
    6044QStringList Port::HID::probedDeviceList()