diff options
author | Stefan Tauner <stefan.tauner@gmx.at> | 2016-01-19 00:02:16 +0100 |
---|---|---|
committer | Nathan Hjelm <hjelmn@me.com> | 2016-03-05 07:55:25 -0700 |
commit | 1fd08a1513dc323ddf7fae97888eb09215a1f0b6 (patch) | |
tree | 1482490e72a81a368c90e6aae53761d611eb4619 /libusb/hotplug.c | |
parent | fb2b6b2a92a41706a7d4ef4734aba7849c84cdf8 (diff) | |
download | libusb-1fd08a1513dc323ddf7fae97888eb09215a1f0b6.tar.gz |
Replace obsolete usleep with nanosleep
This fixes compiling libusb with uclibc.
Closes #141, #165
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Diffstat (limited to 'libusb/hotplug.c')
-rw-r--r-- | libusb/hotplug.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libusb/hotplug.c b/libusb/hotplug.c index 5db8d0b..bbfd6e7 100644 --- a/libusb/hotplug.c +++ b/libusb/hotplug.c @@ -94,6 +94,7 @@ \code #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <libusb.h> static int count = 0; @@ -142,7 +143,7 @@ int main (void) { while (count < 2) { libusb_handle_events_completed(NULL, NULL); - usleep(10000); + nanosleep(&(struct timespec){0, 10000000UL}, NULL); } libusb_hotplug_deregister_callback(NULL, callback_handle); |