serialization of handle_events
0.1 compat layer
internal docs for OS porters
-passing of "access denied" error code from op_open
1.0 API style/naming points to reconsider
=========================================
hpriv->fd = open(dpriv->nodepath, O_RDWR);
if (hpriv->fd < 0) {
- usbi_err("open failed, code %d errno %d", hpriv->fd, errno);
- return -EIO;
+ if (errno == EACCES) {
+ fprintf(stderr, "libusb couldn't open USB device %s: "
+ "Permission denied.\n"
+ "libusb requires write access to USB device nodes.\n",
+ dpriv->nodepath);
+ return -EACCES;
+ } else {
+ usbi_err("open failed, code %d errno %d", hpriv->fd, errno);
+ return -EIO;
+ }
}
return usbi_add_pollfd(hpriv->fd, POLLOUT);