darwin: shorten hotplug poll timeout
authorNathan Hjelm <hjelmn@me.com>
Wed, 9 Jan 2019 01:26:48 +0000 (18:26 -0700)
committerNathan Hjelm <hjelmn@me.com>
Wed, 9 Jan 2019 01:28:10 +0000 (18:28 -0700)
Looks like 5 seconds was indeed too long. Shortened the timeout to
1ms instead.

Closes #516

Signed-off-by: Nathan Hjelm <hjelmn@me.com>
libusb/os/darwin_usb.c
libusb/version_nano.h

index 2eb57c7..61a09af 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode:nil -*- */
 /*
  * darwin backend for libusb 1.0
- * Copyright © 2008-2018 Nathan Hjelm <hjelmn@users.sourceforge.net>
+ * Copyright © 2008-2019 Nathan Hjelm <hjelmn@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -380,8 +380,8 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) {
 
 static void darwin_hotplug_poll (void)
 {
-  /* not sure if 5 seconds will be too long/short but it should work ok */
-  mach_timespec_t timeout = {.tv_sec = 5, .tv_nsec = 0};
+  /* not sure if 1 ms will be too long/short but it should work ok */
+  mach_timespec_t timeout = {.tv_sec = 0, .tv_nsec = 1000000ul};
 
   /* since a kernel thread may nodify the IOInterators used for
    * hotplug notidication we can't just clear the iterators.
index df073bd..6078946 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11339
+#define LIBUSB_NANO 11340