diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c index f887f6d0d0..d2b219a12f 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c @@ -2,16 +2,16 @@ * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this + * of this license, see the COPYING file at the top level of this * source tree. * Test that pthread_cond_timedwait() - * shall be equivalent to pthread_cond_wait(), except that an error is returned + * shall be equivalent to pthread_cond_wait(), except that an error is returned * if the absolute time specified by abstime has already been passed at the time * of the call. - * + * */ - + #define _XOPEN_SOURCE 600 #include @@ -37,14 +37,14 @@ void *t1_func(void *arg) int rc; struct timeval curtime; struct timespec timeout; - + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr,"Thread1 failed to acquire the mutex\n"); exit(PTS_UNRESOLVED); } fprintf(stderr,"Thread1 started\n"); t1_start = 1; /* let main thread continue */ - + if (gettimeofday(&curtime, NULL) !=0 ) { fprintf(stderr,"Fail to get current time\n"); exit(PTS_UNRESOLVED); @@ -85,7 +85,7 @@ int main() return PTS_UNRESOLVED; } - /* If the thread hasn't ended in 5 seconds, then most probably + /* If the thread hasn't ended in 5 seconds, then most probably * pthread_cond_timedwait is failing to function correctly. */ alarm(5); @@ -96,29 +96,24 @@ int main() return PTS_UNRESOLVED; } - /* Make sure pthread_cond_timedwait released and re-acquired the mutex + /* Make sure pthread_cond_timedwait released and re-acquired the mutex * as it should. */ rc=pthread_mutex_trylock(&td.mutex); - if (rc == 0) { + if (rc == 0) { fprintf(stderr,"Test FAILED: Did not re-acquire mutex after timedout out call to pthread_cond_timedwait\n"); return PTS_FAIL; } - if (pthread_mutex_unlock(&td.mutex) != 0) { - fprintf(stderr,"Main failed to release mutex\n"); - return PTS_UNRESOLVED; - } - if(th_ret == PTS_PASS) { - printf("Test PASSED\n"); + printf("Test PASSED\n"); return PTS_PASS; } else if(th_ret == PTS_FAIL) { - printf("Test FAILED\n"); + printf("Test FAILED\n"); return PTS_FAIL; } else - return PTS_UNRESOLVED; + return PTS_UNRESOLVED; }