You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/linux/hid.c b/linux/hid.c
index 56dac0f..f99cd5c 100644
--- a/linux/hid.c
+++ b/linux/hid.c
@@ -629,7 +629,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
dev->device_handle = open(path, O_RDWR);
/* If we have a good handle, return it. */
- if (dev->device_handle > 0) {
+ if (dev->device_handle >= 0) {
/* Get the report descriptor */
int res, desc_size = 0;
The text was updated successfully, but these errors were encountered:
Playing with usbrelay (which uses hidapi), I noticed that it fails if FD 0 is closed and that an open result is FD 0 being allocated by the kernel:
strace confirms this:
The bug seems to be here:
hidapi/linux/hid.c
Line 632 in 98629a1
easily fixed with:
The text was updated successfully, but these errors were encountered: