[LTP] [PATCH 7/7] opeposix: pthread_barrierattr_getpshared/2-1: Simplify codeflow
Martin Doucha
mdoucha@suse.cz
Thu Jun 23 14:38:22 CEST 2022
Hi,
one small suggestion below, otherwise for the whole patchset:
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
On 20. 06. 22 11:21, Cyril Hrubis wrote:
> This actually fixes a 'no return in nonvoid function' warning since gcc
> may get confused during the codeflow analysis.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> .../interfaces/pthread_barrierattr_getpshared/2-1.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
> index a21a5a507..52c074173 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
> @@ -141,7 +141,9 @@ int main(void)
> if (pid == -1) {
> perror("Error at fork()");
> return PTS_UNRESOLVED;
> - } else if (pid == 0) {
> + }
> +
> + if (pid == 0) {
> /* Child */
> /* Map the shared object to child's memory */
> barrier =
> @@ -209,10 +211,7 @@ int main(void)
>
> printf("Test PASSED\n");
> return PTS_PASS;
> + } else {
> + return serial;
The return can be unconditional.
> }
> -
> - if (pid == 0) {
> - exit(serial);
> - }
> -
> }
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list