summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodney <andrew.goodney@gmail.com>2022-02-16 13:28:14 -0800
committerTormod Volden <debian.tormod@gmail.com>2022-03-16 17:53:00 +0100
commit02dc54936899150bb442e9195133f72702a79b67 (patch)
tree5f678ec830d47c20a42286087bd8163c95ec34ee
parentf9162d36bf7253b3743d2973e385d32166ea0795 (diff)
downloadlibusb-02dc54936899150bb442e9195133f72702a79b67.tar.gz
darwin: Use usbi_get_monotonic_time() wrapper
On macOS < 10.12 we cannot use clock_gettime(). Closes #1070
-rw-r--r--libusb/os/darwin_usb.c4
-rw-r--r--libusb/version_nano.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index 903422c..4fac3fd 100644
--- a/libusb/os/darwin_usb.c
+++ b/libusb/os/darwin_usb.c
@@ -1801,14 +1801,14 @@ static int darwin_reenumerate_device (struct libusb_device_handle *dev_handle, b
usbi_dbg (ctx, "darwin/reenumerate_device: waiting for re-enumeration to complete...");
struct timespec start;
- clock_gettime(CLOCK_MONOTONIC, &start);
+ usbi_get_monotonic_time(&start);
while (dpriv->in_reenumerate) {
struct timespec delay = {.tv_sec = 0, .tv_nsec = 1000};
nanosleep (&delay, NULL);
struct timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
+ usbi_get_monotonic_time(&now);
UInt32 elapsed = (now.tv_sec - start.tv_sec) * 1000000 + (now.tv_nsec - start.tv_nsec) / 1000;
if (elapsed >= DARWIN_REENUMERATE_TIMEOUT_US) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 6e2b30b..014b2ef 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11698
+#define LIBUSB_NANO 11699