version 1.6, 2004/10/27 18:16:57 |
version 1.7, 2006/04/23 08:51:24 |
|
|
fd = open(dev, O_RDWR); |
fd = open(dev, O_RDWR); |
if (fd < 0) |
if (fd < 0) |
err(1, "%s", dev); |
err(1, "%s", dev); |
|
|
|
/* Avoid passing the device file descriptor to executed commands */ |
|
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) |
|
err(1, "fcntl(F_SETFD, FD_CLOEXEC)"); |
|
|
if (ioctl(fd, USB_GET_REPORT_ID, &reportid) < 0) |
if (ioctl(fd, USB_GET_REPORT_ID, &reportid) < 0) |
reportid = -1; |
reportid = -1; |
repd = hid_get_report_desc(fd); |
repd = hid_get_report_desc(fd); |