mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-25 13:37:18 +08:00
2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* posix/src/nanosleep.c, posix/src/timersettime.c: Removed redundent code and cleaned up error checking code.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2010-06-22 Jennifer Averett <Jennifer.Averett@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@embedded-brains.de>
|
||||
|
||||
* libcsupport/src/mount.c: Fixed string assignment in mount entry
|
||||
|
||||
@@ -36,8 +36,6 @@ int nanosleep(
|
||||
{
|
||||
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 @@ int nanosleep(
|
||||
* 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 );
|
||||
|
||||
@@ -42,12 +42,14 @@ int timer_settime(
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user