[Pkg-wmaker-commits] [wmppp.app] 80/120: wmppp.app: Replace deprecated usleep with nanosleep.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 12:04:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmppp.app.

commit 21483776a9a2534a3dd6e5874753fe34c4a34c0e
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Tue May 19 22:31:02 2015 -0500

    wmppp.app: Replace deprecated usleep with nanosleep.
---
 wmppp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/wmppp.c b/wmppp.c
index 932d1df..723864f 100644
--- a/wmppp.c
+++ b/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);
 	}
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmppp.app.git



More information about the Pkg-wmaker-commits mailing list