mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
libshout: don't use usleep
usleep is deprecated and optionally unavailable with uClibc-ng. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
--- 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user