summaryrefslogtreecommitdiff
path: root/examples/xusb.c
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2011-06-28 11:56:03 +0100
committerPete Batard <pete@akeo.ie>2011-06-28 11:56:03 +0100
commit11c2d76a3ea3be1869c6c15c9f755a3d10607676 (patch)
tree49b984bf01163c580ee8dd197e5593c7e4da0552 /examples/xusb.c
parentd65eef68d34b10a9875eb5b94602f3bd9e70172a (diff)
downloadlibusb-11c2d76a3ea3be1869c6c15c9f755a3d10607676.tar.gz
[xusb] fixed xusb no longer detaching driver on Linux
* OS_LINUX is no longer defined as it came from config.h
Diffstat (limited to 'examples/xusb.c')
-rw-r--r--examples/xusb.c6
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);