Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177536024
D54296.1794654768.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1009 B
Referenced Files
None
Subscribers
None
D54296.1794654768.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,8 @@
*/
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
Sat, Nov 14, 11:12 AM (1 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41722373
Default Alt Text
D54296.1794654768.diff (1009 B)
Attached To
Mode
D54296: PR 291774: expand range of errors reported by libusb_open(3)
Attached
Detach File
Event Timeline