summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-04 14:39:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-04 14:39:37 +0000
commitc0694b06377eade4fc3dcbb6c5f372dbde5ba125 (patch)
tree4c8b01d16b64d74f44cc9b351c29eb846f414a29
parent2008-08-01 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-c0694b06377eade4fc3dcbb6c5f372dbde5ba125.tar.bz2
2008-08-04 Tim FitzGeorge <tim.fitzgeorge@astrium.eads.net>
PR 1293/tests * psx10/init.c: Make sure we do not let tv_nsec go to -1.
-rw-r--r--testsuites/psxtests/ChangeLog5
-rw-r--r--testsuites/psxtests/psx10/init.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index 202f1d7a6f..83b52f5a63 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-04 Tim FitzGeorge <tim.fitzgeorge@astrium.eads.net>
+
+ PR 1293/tests
+ * psx10/init.c: Make sure we do not let tv_nsec go to -1.
+
2008-07-22 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1291/cpukit
diff --git a/testsuites/psxtests/psx10/init.c b/testsuites/psxtests/psx10/init.c
index a9749e0087..2688e5d640 100644
--- a/testsuites/psxtests/psx10/init.c
+++ b/testsuites/psxtests/psx10/init.c
@@ -247,9 +247,14 @@ void *POSIX_Init(
status = pthread_mutex_lock( &Mutex_id );
assert( !status );
- status = clock_gettime( CLOCK_REALTIME, &timeout );
- assert( !status );
- timeout.tv_nsec -= 1;
+
+ /* ensure we do not catch a 0 nanosecond boundary */
+ do {
+ status = clock_gettime( CLOCK_REALTIME, &timeout );
+ assert( !status );
+ timeout.tv_nsec -= 1;
+ } while ( timeout.tv_nsec < 0);
+
status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout );
if ( status != ETIMEDOUT )
printf( "status = %d\n", status );