Browse Source

Try: avoid root access by NOT trying to detach any kext. (works on my machine)

master v0.1
heck 2 years ago
parent
commit
8d4c2cf03d
  1. 16
      src/libch341eeprom.c

16
src/libch341eeprom.c

@ -112,14 +112,14 @@ struct libusb_device_handle *ch341configure(uint16_t vid, uint16_t pid)
log_debug("Opened device [%04x:%04x]\n", USB_LOCK_VENDOR, USB_LOCK_PRODUCT);
if (libusb_kernel_driver_active(devHandle, DEFAULT_INTERFACE)) {
ret = libusb_detach_kernel_driver(devHandle, DEFAULT_INTERFACE);
if (ret) {
fprintf(stderr, "Failed to detach kernel driver: '%s'\n", strerror(-ret));
return NULL;
} else
log_debug("Detached kernel driver\n");
}
// if (libusb_kernel_driver_active(devHandle, DEFAULT_INTERFACE)) {
// ret = libusb_detach_kernel_driver(devHandle, DEFAULT_INTERFACE);
// if (ret) {
// fprintf(stderr, "Failed to detach kernel driver: '%s'\n", strerror(-ret));
// return NULL;
// } else
// log_debug("Detached kernel driver\n");
// }
ret = libusb_get_configuration(devHandle, &currentConfig);
if (ret) {

Loading…
Cancel
Save