nanosleep patch
I can't create a merge request so here's a patch:
From 4467530c2396c61e886bf2dc4563be0e9c54394b Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 3 Apr 2020 19:32:39 -0700
Subject: [PATCH] nonblocking: remove usleep usage
usleep is deprecated under POSIX 2008 and is optionally unavailable
with uClibc-ng.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
examples/nonblocking.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/examples/nonblocking.c b/examples/nonblocking.c
index 8e38a94..2f15b80 100644
--- a/examples/nonblocking.c
+++ b/examples/nonblocking.c
@@ -70,8 +70,10 @@ int main()
if (ret == SHOUTERR_BUSY)
printf("Connection pending...\n");
+ const struct timespec req = {0, 10 * 1000 * 1000};
+ struct timespec rem;
while (ret == SHOUTERR_BUSY) {
- usleep(10000);
+ nanosleep(&req, &rem);
ret = shout_get_connected(shout);
}
--
2.26.2