diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2010-06-22 15:36:06 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2010-06-22 15:36:06 +0000 |
commit | f5dc557118e74876e3b11a51bf4d32d736785754 (patch) | |
tree | 6781705fc69224679deb235c4ff06e27e1c51a5d /cpukit/posix/src/timersettime.c | |
parent | 2010-06-22 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-f5dc557118e74876e3b11a51bf4d32d736785754.tar.bz2 |
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.
Diffstat (limited to 'cpukit/posix/src/timersettime.c')
-rw-r--r-- | cpukit/posix/src/timersettime.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cpukit/posix/src/timersettime.c b/cpukit/posix/src/timersettime.c index de81dab694..d618bd391e 100644 --- a/cpukit/posix/src/timersettime.c +++ b/cpukit/posix/src/timersettime.c @@ -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 ); } |