Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163289714
D54296.id168409.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1007 B
Referenced Files
None
Subscribers
None
D54296.id168409.diff
View Options
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -639,7 +639,20 @@
err = libusb20_dev_open(pdev, LIBUSB_NUM_SW_ENDPOINTS);
if (err) {
libusb_unref_device(dev);
- return (LIBUSB_ERROR_NO_MEM);
+ switch (err) {
+ /*
+ * These are all equal in value to
+ * their LIBUSB_ERROR_* counterparts.
+ */
+ case LIBUSB20_ERROR_ACCESS:
+ case LIBUSB20_ERROR_BUSY:
+ case LIBUSB20_ERROR_INVALID_PARAM:
+ case LIBUSB20_ERROR_NO_DEVICE:
+ case LIBUSB20_ERROR_NO_MEM:
+ return (err);
+ default:
+ return (LIBUSB_ERROR_OTHER);
+ }
}
/*
diff --git a/lib/libusb/libusb20_ugen20.c b/lib/libusb/libusb20_ugen20.c
--- a/lib/libusb/libusb20_ugen20.c
+++ b/lib/libusb/libusb20_ugen20.c
@@ -393,7 +393,7 @@
*/
g = open(buf, O_RDWR);
if (g < 0) {
- return (LIBUSB20_ERROR_NO_DEVICE);
+ return ((EACCES == errno) ? LIBUSB20_ERROR_ACCESS : LIBUSB20_ERROR_NO_DEVICE);
}
f = open(buf, O_RDWR);
if (f < 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 6:47 PM (10 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35377154
Default Alt Text
D54296.id168409.diff (1007 B)
Attached To
Mode
D54296: PR 291774: expand range of errors reported by libusb_open(3)
Attached
Detach File
Event Timeline
Log In to Comment