[LTP] [PATCH 7/7] opeposix: pthread_barrierattr_getpshared/2-1: Simplify codeflow

Cyril Hrubis chrubis@suse.cz
Thu Jul 14 15:03:44 CEST 2022


Hi!
> > +	} else {
> > +		return serial;
> 
> The return can be unconditional.

I changed the code a bit more in the end to make it even more readable,
now it's structured as:

	if (pid == 0)
		return serial;

	/* parent */
	if (wait(&status) != pid) {
		...
	}
	...

	printf("Test PASSED\n");
	return PTS_PASS;

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list