tests: posix: common: remove duplicate call to pthread_attr_init

There was a second call to `pthread_attr_init()` that reallly had
no sense being there. Also, it seems that there was a call to
`pthread_attr_destroy()` out of perhaps paranoia.

The duplicate call and `pthread_attr_destroy()` can be removed.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
This commit is contained in:
Chris Friedt 2022-11-16 16:58:41 -05:00 committed by Stephanos Ioannidis
commit d1e7ccec24

View file

@ -76,11 +76,7 @@ ZTEST(posix_apis, test_posix_mqueue)
for (i = 0; i < N_THR; i++) {
/* Creating threads */
if (pthread_attr_init(&attr[i]) != 0) {
zassert_equal(pthread_attr_destroy(&attr[i]), 0);
zassert_false(pthread_attr_init(&attr[i]),
"pthread attr init failed");
}
zassert_ok(pthread_attr_init(&attr[i]));
pthread_attr_setstack(&attr[i], &stacks[i][0], STACKSZ);
if (i % 2) {