[LTP] [PATCH] openposix: make use of tst_process_state_wait3
Cyril Hrubis
chrubis@suse.cz
Tue Sep 7 11:54:26 CEST 2021
Hi!
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c
> index 04ef0a2cc..554714695 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c
> @@ -17,6 +17,7 @@
> #include <stdlib.h>
> #include <errno.h>
> #include "posixtest.h"
> +#include "proc.h"
>
> #define SLEEPSEC 30
>
> @@ -88,7 +89,7 @@ int main(void)
> /* parent here */
> int i;
>
> - sleep(1);
> + tst_process_state_wait3(pid, 'S', 1);
This test is actually the only one that looks at the remining time as
returned by clock_nanosleep() so it may make a sense to keep the
sleep(1) in this test so that the remaining time is smaller than the
sleep time by some reasonable margin. But I guess that the test will
work fine without it as well.
The rest is obviously fine.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list