name 使用root会导致一个io错误
This commit is contained in:
parent
9eead04e8e
commit
63acafc433
|
@ -552,7 +552,7 @@ int usb_device::open(libusb_device_handle** dev_handle)
|
|||
std::string fmt("\\%d"), root("");
|
||||
|
||||
if (udev_.driver_key.length())
|
||||
root = usb_device::usb_scan_name(udev_.driver_key.c_str());
|
||||
root = usb_device::usb_scan_name(udev_.driver_key.c_str());//name使用root时会导致 IO一个异常
|
||||
if (root.empty())
|
||||
{
|
||||
VLOG_MINI_1(LOG_LEVEL_WARNING, "Cannot find '\\\\.\\Usbscan' name for '%s', try run in Administrator!\r\n", udev_.name.c_str());
|
||||
|
@ -563,7 +563,7 @@ int usb_device::open(libusb_device_handle** dev_handle)
|
|||
{
|
||||
VLOG_MINI_2(LOG_LEVEL_WARNING, "Nice: '%s' for '%s'.\r\n", root.c_str(), udev_.name.c_str());
|
||||
}
|
||||
h = open_usb(root.c_str());
|
||||
h = open_usb(udev_.name.c_str());
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
*dev_handle = NULL;
|
||||
|
|
Loading…
Reference in New Issue