mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-09 21:41:29 +00:00
correct use of USBDEVFS_DISCONNECT
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1621 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
9e61bde56a
commit
868bfe2b2b
13
usb-linux.c
13
usb-linux.c
@ -181,10 +181,15 @@ USBDevice *usb_host_device_open(const char *devname)
|
|||||||
|
|
||||||
#ifdef USBDEVFS_DISCONNECT
|
#ifdef USBDEVFS_DISCONNECT
|
||||||
/* earlier Linux 2.4 do not support that */
|
/* earlier Linux 2.4 do not support that */
|
||||||
ret = ioctl(fd, USBDEVFS_DISCONNECT);
|
{
|
||||||
if (ret < 0 && errno != ENODATA) {
|
struct usbdevfs_ioctl ctrl;
|
||||||
perror("USBDEVFS_DISCONNECT");
|
ctrl.ioctl_code = USBDEVFS_DISCONNECT;
|
||||||
goto fail;
|
ctrl.ifno = 0;
|
||||||
|
ret = ioctl(fd, USBDEVFS_IOCTL, &ctrl);
|
||||||
|
if (ret < 0 && errno != ENODATA) {
|
||||||
|
perror("USBDEVFS_DISCONNECT");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user