diff mbox

[3/3] LTP: prio-wake- eliminate deprecated usleep calls

Message ID 1406326845-17506-4-git-send-email-gary.robertson@linaro.org
State New
Headers show

Commit Message

gary.robertson@linaro.org July 25, 2014, 10:20 p.m. UTC
From: "Gary S. Robertson" <gary.robertson@linaro.org>

Minor cleanup on realtime test prio-wake.
Replaced deprecated usleep calls with calls to rt_nanosleep,
which has no potentially adverse interactions with signals.

Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
---
 ...io-wake-eliminate-deprecated-usleep-calls.patch |   33 ++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20140422.bb          |    1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-extended/ltp/ltp/0001-prio-wake-eliminate-deprecated-usleep-calls.patch
diff mbox

Patch

diff --git a/meta/recipes-extended/ltp/ltp/0001-prio-wake-eliminate-deprecated-usleep-calls.patch b/meta/recipes-extended/ltp/ltp/0001-prio-wake-eliminate-deprecated-usleep-calls.patch
new file mode 100644
index 0000000..4a43703
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-prio-wake-eliminate-deprecated-usleep-calls.patch
@@ -0,0 +1,33 @@ 
+From 38283c837a56d64f3d23b57e082956916fe085b2 Mon Sep 17 00:00:00 2001
+From: "Gary S. Robertson" <gary.robertson@linaro.org>
+Date: Fri, 25 Jul 2014 09:50:35 -0500
+Subject: [PATCH] prio-wake: eliminate deprecated usleep calls
+
+Replaced deprecated usleep calls with calls to rt_nanosleep,
+which has no potentially adverse interactions with signals.
+
+Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
+---
+ testcases/realtime/func/prio-wake/prio-wake.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/realtime/func/prio-wake/prio-wake.c b/testcases/realtime/func/prio-wake/prio-wake.c
+index 18c0405..f34ae30 100644
+--- a/testcases/realtime/func/prio-wake/prio-wake.c
++++ b/testcases/realtime/func/prio-wake/prio-wake.c
+@@ -108,10 +108,10 @@ void *master_thread(void *arg)
+ 
+ 	/* make sure children are started */
+ 	while (running_threads < rt_threads)
+-		usleep(1000);
++		rt_nanosleep(1000000);
+ 	/* give the worker threads a chance to get to sleep in the kernel
+ 	 * in the unlocked broadcast case. */
+-	usleep(1000);
++	rt_nanosleep(1000000);
+ 
+ 	start = rt_gettime() - beginrun;
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/ltp/ltp_20140422.bb b/meta/recipes-extended/ltp/ltp_20140422.bb
index f86a195..77c79f5 100644
--- a/meta/recipes-extended/ltp/ltp_20140422.bb
+++ b/meta/recipes-extended/ltp/ltp_20140422.bb
@@ -28,6 +28,7 @@  SRC_URI = "git://github.com/linux-test-project/ltp.git \
     file://automake-foreign.patch \
     file://0001-Allow-mutex-initialization-without-PI-configured.patch \
     file://0001-pthread_cond_many-fix-uninitialized-return-in-option.patch \
+    file://0001-prio-wake-eliminate-deprecated-usleep-calls.patch \
 "
 
 S = "${WORKDIR}/git"