Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I Icecast-libshout
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 20
    • Issues 20
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.OrgXiph.Org
  • Icecast-libshout
  • Issues
  • #2317
Closed
Open
Issue created Jul 21, 2020 by Rosen Penev@neheb

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
Assignee
Assign to
Time tracking