From c1b23f6a43fc8a45a4f948acae33d1b6c4b14136 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 19 May 2015 22:31:02 -0500 Subject: [PATCH] wmppp.app: Replace deprecated usleep with nanosleep. --- wmppp.app/wmppp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 932d1df..723864f 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -460,6 +460,7 @@ void wmppp_routine(int argc, char **argv) { while (1) { int i; long lasttime; + struct timespec ts; lasttime = currenttime; currenttime = time(0); @@ -602,7 +603,9 @@ void wmppp_routine(int argc, char **argv) { i = waitpid(0, &status, WNOHANG); if (i == stop_child) stop_child = 0; if (i == start_child) start_child = 0; - usleep(50000l); + ts.tv_sec = 0; + ts.tv_nsec = 50000000L; + nanosleep(&ts, NULL); } exit(0); break; @@ -659,7 +662,9 @@ void wmppp_routine(int argc, char **argv) { break; } } - usleep(50000L); + ts.tv_sec = 0; + ts.tv_nsec = 50000000L; + nanosleep(&ts, NULL); } }