Commit 3b2ccc57c74a3a7405dabd36f7abacd3eff46b46
1 parent
74ccb34e
Linux compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2065 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
0 deletions
usb-linux.c
| ... | ... | @@ -26,6 +26,7 @@ |
| 26 | 26 | #if defined(__linux__) |
| 27 | 27 | #include <dirent.h> |
| 28 | 28 | #include <sys/ioctl.h> |
| 29 | +#include <linux/compiler.h> | |
| 29 | 30 | #include <linux/usbdevice_fs.h> |
| 30 | 31 | #include <linux/version.h> |
| 31 | 32 | |
| ... | ... | @@ -59,6 +60,14 @@ typedef struct USBHostDevice { |
| 59 | 60 | |
| 60 | 61 | static void usb_host_handle_reset(USBDevice *dev, int destroy) |
| 61 | 62 | { |
| 63 | + USBHostDevice *s = (USBHostDevice *)dev; | |
| 64 | + | |
| 65 | + if (destroy) { | |
| 66 | + if (s->fd >= 0) | |
| 67 | + close(s->fd); | |
| 68 | + qemu_free(s); | |
| 69 | + return; | |
| 70 | + } | |
| 62 | 71 | #if 0 |
| 63 | 72 | USBHostDevice *s = (USBHostDevice *)dev; |
| 64 | 73 | /* USBDEVFS_RESET, but not the first time as it has already be | ... | ... |