The sleep(3) call can return the number of seconds left to sleep if interrupted. Handle the intteruption in the health stall test.
Signed-off-by: Christian Babeux <christian.bab...@efficios.com> --- tests/tools/health/health_stall.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/tools/health/health_stall.c b/tests/tools/health/health_stall.c index f91bd49..38fe5f8 100644 --- a/tests/tools/health/health_stall.c +++ b/tests/tools/health/health_stall.c @@ -43,7 +43,10 @@ void __testpoint_thread_manage_clients_before_loop(void) const char *var = "LTTNG_THREAD_MANAGE_CLIENTS_STALL"; if (check_env_var(var)) { - sleep(STALL_TIME); + unsigned int sleep_time = STALL_TIME; + while (sleep_time > 0) { + sleep_time = sleep(sleep_time); + } } } @@ -52,7 +55,10 @@ void __testpoint_thread_manage_kernel_before_loop(void) const char *var = "LTTNG_THREAD_MANAGE_KERNEL_STALL"; if (check_env_var(var)) { - sleep(STALL_TIME); + unsigned int sleep_time = STALL_TIME; + while (sleep_time > 0) { + sleep_time = sleep(sleep_time); + } } } @@ -61,6 +67,9 @@ void __testpoint_thread_manage_apps_before_loop(void) const char *var = "LTTNG_THREAD_MANAGE_APPS_STALL"; if (check_env_var(var)) { - sleep(STALL_TIME); + unsigned int sleep_time = STALL_TIME; + while (sleep_time > 0) { + sleep_time = sleep(sleep_time); + } } } -- 1.8.0.1 _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev