summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2012-05-10 15:35:07 +0100
committerPete Batard <pete@akeo.ie>2012-05-10 15:36:34 +0100
commit207566535293136c89bc5b7df8c588418171e54f (patch)
treec2d6c405bfeaff09f92addb6931559b901c2915a /examples
parent3c755e14d525a85f05e40c8a8ed785a77a218680 (diff)
downloadlibusb-207566535293136c89bc5b7df8c588418171e54f.tar.gz
Samples: prefer __linux__ over __linux define in xusb
* While both should work, __linux__ seems to be preferred and what we use in threads_posix.c * Also fix a typo in .private/README.txt
Diffstat (limited to 'examples')
-rw-r--r--examples/xusb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index c811353..2c0409f 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -583,7 +583,7 @@ static int test_device(uint16_t vid, uint16_t pid)
const struct libusb_endpoint_descriptor *endpoint;
int i, j, k, r;
int iface, nb_ifaces, first_iface = -1;
-#if defined(__linux)
+#if defined(__linux__)
// Attaching/detaching the kernel driver is only relevant for Linux
int iface_detached = -1;
#endif
@@ -679,7 +679,7 @@ static int test_device(uint16_t vid, uint16_t pid)
{
printf("\nClaiming interface %d...\n", iface);
r = libusb_claim_interface(handle, iface);
-#if defined(__linux)
+#if defined(__linux__)
if ((r != LIBUSB_SUCCESS) && (iface == 0)) {
// Maybe we need to detach the driver
perr(" Failed. Trying to detach driver...\n");
@@ -734,7 +734,7 @@ static int test_device(uint16_t vid, uint16_t pid)
libusb_release_interface(handle, iface);
}
-#if defined(__linux)
+#if defined(__linux__)
if (iface_detached >= 0) {
printf("Re-attaching kernel driver...\n");
libusb_attach_kernel_driver(handle, iface_detached);