change log for rtems (2010-06-22)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Jun 22 16:11:55 UTC 2010


 *jennifer*:
2010-06-22	Jennifer Averett <Jennifer.Averett at OARcorp.com>

	* posix/src/nanosleep.c, posix/src/timersettime.c: Removed redundent
	code and cleaned up error checking code.

M 1.2450  cpukit/ChangeLog
M   1.11  cpukit/posix/src/nanosleep.c
M   1.10  cpukit/posix/src/timersettime.c

diff -u rtems/cpukit/ChangeLog:1.2449 rtems/cpukit/ChangeLog:1.2450
--- rtems/cpukit/ChangeLog:1.2449	Tue Jun 22 08:31:13 2010
+++ rtems/cpukit/ChangeLog	Tue Jun 22 10:36:05 2010
@@ -1,3 +1,8 @@
+2010-06-22	Jennifer Averett <Jennifer.Averett at OARcorp.com>
+
+	* posix/src/nanosleep.c, posix/src/timersettime.c: Removed redundent
+	code and cleaned up error checking code.
+
 2010-06-22	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	* libcsupport/src/mount.c: Fixed string assignment in mount entry

diff -u rtems/cpukit/posix/src/nanosleep.c:1.10 rtems/cpukit/posix/src/nanosleep.c:1.11
--- rtems/cpukit/posix/src/nanosleep.c:1.10	Sun Sep 13 19:14:22 2009
+++ rtems/cpukit/posix/src/nanosleep.c	Tue Jun 22 10:36:06 2010
@@ -36,8 +36,6 @@
 {
   Watchdog_Interval  ticks;
 
-  if ( !_Timespec_Is_valid( rqtp ) )
-    rtems_set_errno_and_return_minus_one( EINVAL );
 
   /*
    *  Return EINVAL if the delay interval is negative.
@@ -45,7 +43,7 @@
    *  NOTE:  This behavior is beyond the POSIX specification.
    *         FSU and GNU/Linux pthreads shares this behavior.
    */
-  if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
+  if ( !_Timespec_Is_valid( rqtp ) )
     rtems_set_errno_and_return_minus_one( EINVAL );
 
   ticks = _Timespec_To_ticks( rqtp );

diff -u rtems/cpukit/posix/src/timersettime.c:1.9 rtems/cpukit/posix/src/timersettime.c:1.10
--- rtems/cpukit/posix/src/timersettime.c:1.9	Thu Dec 10 16:20:11 2009
+++ rtems/cpukit/posix/src/timersettime.c	Tue Jun 22 10:36:06 2010
@@ -42,12 +42,14 @@
   if ( !value )
     rtems_set_errno_and_return_minus_one( EINVAL );
 
-  /* First, it verifies if the structure "value" is correct */
-  if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) ||
-       ( value->it_value.tv_nsec < 0 ) ||
-       ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) ||
-       ( value->it_interval.tv_nsec < 0 )) {
-    /* The number of nanoseconds is not correct */
+  /* 
+   * First, it verifies if the structure "value" is correct   
+   * if the number of nanoseconds is not correct return EINVAL
+   */
+  if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
+    rtems_set_errno_and_return_minus_one( EINVAL );
+  }
+  if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
     rtems_set_errno_and_return_minus_one( EINVAL );
   }
 



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100622/92ef5b02/attachment-0001.html>


More information about the vc mailing list