diff options
author | Pete Batard <pete@akeo.ie> | 2011-06-28 11:56:03 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2011-06-28 11:56:03 +0100 |
commit | 11c2d76a3ea3be1869c6c15c9f755a3d10607676 (patch) | |
tree | 49b984bf01163c580ee8dd197e5593c7e4da0552 | |
parent | d65eef68d34b10a9875eb5b94602f3bd9e70172a (diff) | |
download | libusb-11c2d76a3ea3be1869c6c15c9f755a3d10607676.tar.gz |
[xusb] fixed xusb no longer detaching driver on Linux
* OS_LINUX is no longer defined as it came from config.h
-rw-r--r-- | examples/xusb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index 0c03fb6..c5eab38 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -535,7 +535,7 @@ int test_device(uint16_t vid, uint16_t pid) const struct libusb_endpoint_descriptor *endpoint; int i, j, k, r; int iface, nb_ifaces; -#ifdef OS_LINUX +#if defined(__linux) // Attaching/detaching the kernel driver is only relevant for Linux int iface_detached = -1; #endif @@ -616,7 +616,7 @@ int test_device(uint16_t vid, uint16_t pid) { printf("\nClaiming interface %d...\n", iface); r = libusb_claim_interface(handle, iface); -#ifdef OS_LINUX +#if defined(__linux) if ((r != LIBUSB_SUCCESS) && (iface == 0)) { // Maybe we need to detach the driver perr(" Failed. Trying to detach driver...\n"); @@ -663,7 +663,7 @@ int test_device(uint16_t vid, uint16_t pid) libusb_release_interface(handle, iface); } -#ifdef OS_LINUX +#if defined(__linux) if (iface_detached >= 0) { printf("Re-attaching kernel driver...\n"); libusb_attach_kernel_driver(handle, iface_detached); |