Index: testsuites/psxtests/ChangeLog
===================================================================
--- testsuites/psxtests/ChangeLog	(revision acb4bed0e943a40c2baae2e01413c54924b1e565)
+++ testsuites/psxtests/ChangeLog	(revision f5119be40abdeaea69e0c9ea09d9ca08e870fee3)
@@ -1,2 +1,9 @@
+2008-07-18	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	PR 1291/cpukit
+	* psx05/init.c, psxmsgq01/init.c: As part of addressing timeouts and
+	POSIX services taking relative instead of absolute time for timeouts,
+	these tests were updated.
+
 2008-07-17	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: testsuites/psxtests/psx05/init.c
===================================================================
--- testsuites/psxtests/psx05/init.c	(revision acb4bed0e943a40c2baae2e01413c54924b1e565)
+++ testsuites/psxtests/psx05/init.c	(revision f5119be40abdeaea69e0c9ea09d9ca08e870fee3)
@@ -1,4 +1,4 @@
 /*
- *  COPYRIGHT (c) 1989-1999.
+ *  COPYRIGHT (c) 1989-2008.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -73,4 +73,25 @@
 }
 
+void calculate_abstimeout(
+  struct timespec *times,
+  uint32_t         seconds,
+  uint32_t         nanoseconds
+)
+{
+  struct timeval       tv1;
+  struct timezone      tz1;
+
+  gettimeofday( &tv1, &tz1 );
+
+  times->tv_sec  = seconds     + tv1.tv_sec;
+  times->tv_nsec = nanoseconds + (tv1.tv_usec * 1000);
+
+  while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
+    times->tv_sec++;
+    times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
+  }
+
+}
+
 void *POSIX_Init(
   void *argument
@@ -344,11 +365,11 @@
   assert( status == EPERM );
 
-  times.tv_sec = 0;
-  times.tv_nsec = 500000000;
   puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" );
+  calculate_abstimeout( &times, 0, (TOD_NANOSECONDS_PER_SECOND / 2) );
+
   status = pthread_mutex_timedlock( &Mutex_id, &times );
-  if ( status != EAGAIN )
-    printf( "status = %d\n", status );
-  assert( status == EAGAIN );
+  if ( status != ETIMEDOUT )
+    printf( "status = %d\n", status );
+  assert( status == ETIMEDOUT );
 
      /* switch to idle */
Index: testsuites/psxtests/psxmsgq01/init.c
===================================================================
--- testsuites/psxtests/psxmsgq01/init.c	(revision acb4bed0e943a40c2baae2e01413c54924b1e565)
+++ testsuites/psxtests/psxmsgq01/init.c	(revision f5119be40abdeaea69e0c9ea09d9ca08e870fee3)
@@ -745,12 +745,14 @@
   char            *msg;
 
-  timeout.tv_sec  = 1;
-  timeout.tv_nsec = 0;
-
   printf( "Init: mq_timedsend - on queue %s ", Test_q[que].name);
   len = Predefined_Msgs[MAXMSG].size;
   msg = Predefined_Msgs[MAXMSG].msg;
+
   gettimeofday( &tv1, &tz1 );
+  timeout.tv_sec  = tv1.tv_sec + 1;
+  timeout.tv_nsec = tv1.tv_usec * 1000;
+
   status = mq_timedsend( Test_q[que].mq, msg, len , 0, &timeout );
+
   gettimeofday( &tv2, &tz2 );
   tv3.tv_sec  = tv2.tv_sec - tv1.tv_sec;
@@ -758,14 +760,9 @@
 
   if ( is_blocking ) { /* Don't verify the non-blocking queue */
-    fatal_int_service_status( status, -1, "mq_timedsend status");
-    fatal_posix_service_status( errno, ETIMEDOUT,  "errno ETIMEDOUT");
-  }
-
-  printf("Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
-
-  if ( is_blocking ) /* non-blocking queue */
-    assert( tv3.tv_sec == 1 );
-  else
-    assert( tv3.tv_sec == 0 );
+    fatal_int_service_status( status, -1, "mq_timedsend status" );
+    fatal_posix_service_status( errno, ETIMEDOUT,  "errno ETIMEDOUT" );
+  }
+
+  printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
 
   if ( que == DEFAULT_RW )
@@ -800,11 +797,16 @@
   int              status;
 
-  tm.tv_sec  = 1;
-  tm.tv_nsec = 0;
-
-  printf( "Init: %s mq_timedreceive - on queue %s ", task_name, Test_q[que].name);
+  printf(
+    "Init: %s mq_timedreceive - on queue %s ",
+    task_name,
+    Test_q[que].name
+  );
 
   gettimeofday( &tv1, &tz1 );
+  tm.tv_sec  = tv1.tv_sec + 1;
+  tm.tv_nsec = tv1.tv_usec * 1000;
+
   status = mq_timedreceive( Test_q[ que ].mq, message, 100, &priority, &tm );
+
   gettimeofday( &tv2, &tz2 );
   tv3.tv_sec  = tv2.tv_sec - tv1.tv_sec;
@@ -816,11 +818,5 @@
   printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
 
-  if ( is_blocking )
-    assert( tv3.tv_sec == 1 );
-  else
-    assert( tv3.tv_sec == 0 );
-}
-
-
+}
 
 void verify_timed_receive()
