From 65c9f1d2cc9f9ddd7b8b9c50d42c9d037030a657 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 21 Nov 2020 09:06:48 -0800 Subject: [PATCH] Fixed upstream bug: FD 0 is a valid file descriptor https://github.com/libusb/hidapi/issues/199 --- src/hidapi/linux/hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c index 4ea77b55b..6a943348b 100644 --- a/src/hidapi/linux/hid.c +++ b/src/hidapi/linux/hid.c @@ -719,7 +719,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive) 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;