diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-08-15 18:58:09 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-08-15 18:58:09 +0000 |
commit | f3e191461c7fef615fb9adc1c3d0cba8112c7ec3 (patch) | |
tree | aa3c4b84b23f973ffb20d5f0dfb7cd9673ea9d90 | |
parent | sched_rr_get_interval: converted assert condition into a standard error (diff) | |
download | rtems-f3e191461c7fef615fb9adc1c3d0cba8112c7ec3.tar.bz2 |
clock_gettime: changed assert condition to a standard error code
clock_getres: now checking for a null pointer being passed in
-rw-r--r-- | c/src/exec/posix/src/time.c | 5 | ||||
-rw-r--r-- | cpukit/posix/src/time.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c index 3a36bb33f5..3302f78554 100644 --- a/c/src/exec/posix/src/time.c +++ b/c/src/exec/posix/src/time.c @@ -166,7 +166,8 @@ int clock_gettime( time_t seconds; long ticks; - assert( tp ); + if ( !tp ) + set_errno_and_return_minus_one( EINVAL ); switch ( clock_id ) { @@ -212,7 +213,7 @@ int clock_getres( ) { if ( !res ) - set_errno_and_return_minus_one( EINVAL ); + set_errno_and_return_minus_one( EINVAL ); switch ( clock_id ) { diff --git a/cpukit/posix/src/time.c b/cpukit/posix/src/time.c index 3a36bb33f5..3302f78554 100644 --- a/cpukit/posix/src/time.c +++ b/cpukit/posix/src/time.c @@ -166,7 +166,8 @@ int clock_gettime( time_t seconds; long ticks; - assert( tp ); + if ( !tp ) + set_errno_and_return_minus_one( EINVAL ); switch ( clock_id ) { @@ -212,7 +213,7 @@ int clock_getres( ) { if ( !res ) - set_errno_and_return_minus_one( EINVAL ); + set_errno_and_return_minus_one( EINVAL ); switch ( clock_id ) { |