diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c index f1ceb9e19f..634132460b 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c @@ -26,7 +26,7 @@ #include "posixtest.h" /* Global pthread_once_t object */ -pthread_once_t once_control; +pthread_once_t once_control = PTHREAD_ONCE_INIT; /* Keeps track of how many times the init function has been called. */ int init_flag; @@ -68,7 +68,6 @@ void *an_init_func2() int main() { pthread_t new_th; - once_control = PTHREAD_ONCE_INIT; init_flag=0; /* Create a thread that will execute the first call to pthread_once() */ diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c index 221ba6a665..11585d6c93 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c @@ -181,7 +181,7 @@ void initializer( void ) void * test( void * arg ) { int ret = 0; - pthread_once_t once_ctl; + pthread_once_t once_ctl = PTHREAD_ONCE_INIT; /* We don't block the signals SIGUSR1 and SIGUSR2 for this THREAD */ ret = pthread_sigmask( SIG_UNBLOCK, &usersigs, NULL ); @@ -196,7 +196,6 @@ void * test( void * arg ) { count_ope++; - once_ctl = PTHREAD_ONCE_INIT; init_ctl = 0; ret = pthread_once( &once_ctl, initializer );