summaryrefslogtreecommitdiff
path: root/usb-linux.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-19 17:54:57 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-19 17:54:57 +0000
commit3b2ccc57c74a3a7405dabd36f7abacd3eff46b46 (patch)
treefb31a13a5b57991c891f2cc45e6914d6280c12a2 /usb-linux.c
parent74ccb34e6b52d06d577b5e3695d86d7f440431df (diff)
downloadqemu-3b2ccc57c74a3a7405dabd36f7abacd3eff46b46.tar.gz
qemu-3b2ccc57c74a3a7405dabd36f7abacd3eff46b46.tar.bz2
qemu-3b2ccc57c74a3a7405dabd36f7abacd3eff46b46.zip
Linux compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2065 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'usb-linux.c')
-rw-r--r--usb-linux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/usb-linux.c b/usb-linux.c
index aa1ded23d0..420382be92 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -26,6 +26,7 @@
#if defined(__linux__)
#include <dirent.h>
#include <sys/ioctl.h>
+#include <linux/compiler.h>
#include <linux/usbdevice_fs.h>
#include <linux/version.h>
@@ -59,6 +60,14 @@ typedef struct USBHostDevice {
static void usb_host_handle_reset(USBDevice *dev, int destroy)
{
+ USBHostDevice *s = (USBHostDevice *)dev;
+
+ if (destroy) {
+ if (s->fd >= 0)
+ close(s->fd);
+ qemu_free(s);
+ return;
+ }
#if 0
USBHostDevice *s = (USBHostDevice *)dev;
/* USBDEVFS_RESET, but not the first time as it has already be