diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-11-13 21:53:15 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-11-13 21:53:15 +0000 |
commit | 868bfe2b2ba2c6c7e6580ad35af85ad3fcb994bb (patch) | |
tree | f27aef8ee4bcf4705bfb8c24789e0a5d56ddc221 | |
parent | 9e61bde56a65c92ff67559f8ab94887f8aa57a4d (diff) |
correct use of USBDEVFS_DISCONNECT
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1621 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | usb-linux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usb-linux.c b/usb-linux.c index cde94cd0a0..216ac20f8e 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -181,10 +181,15 @@ USBDevice *usb_host_device_open(const char *devname) #ifdef USBDEVFS_DISCONNECT /* earlier Linux 2.4 do not support that */ - ret = ioctl(fd, USBDEVFS_DISCONNECT); - if (ret < 0 && errno != ENODATA) { - perror("USBDEVFS_DISCONNECT"); - goto fail; + { + struct usbdevfs_ioctl ctrl; + ctrl.ioctl_code = USBDEVFS_DISCONNECT; + ctrl.ifno = 0; + ret = ioctl(fd, USBDEVFS_IOCTL, &ctrl); + if (ret < 0 && errno != ENODATA) { + perror("USBDEVFS_DISCONNECT"); + goto fail; + } } #endif |