From 5860b90232302865678a6efe57f92ae60a5ef562 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 15 May 2009 17:43:02 +0000 Subject: 2009-05-15 Joel Sherrill * posix/src/getitimer.c, posix/src/setitimer.c: Add error checks and clean up so coverage analysis is possible. --- cpukit/posix/src/getitimer.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'cpukit/posix/src/getitimer.c') diff --git a/cpukit/posix/src/getitimer.c b/cpukit/posix/src/getitimer.c index 1892a6016f..8d1bb97904 100644 --- a/cpukit/posix/src/getitimer.c +++ b/cpukit/posix/src/getitimer.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2008. + * COPYRIGHT (c) 1989-20089 * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -23,12 +23,17 @@ int getitimer( struct itimerval *value ) { + if ( !value ) + rtems_set_errno_and_return_minus_one( EFAULT ); + switch ( which ) { - case ITIMER_REAL: break; - case ITIMER_VIRTUAL: break; - case ITIMER_PROF: break; + case ITIMER_REAL: + case ITIMER_VIRTUAL: + case ITIMER_PROF: + rtems_set_errno_and_return_minus_one( ENOSYS ); + default: + break; } - rtems_set_errno_and_return_minus_one( ENOSYS ); - /* return -1; */ + rtems_set_errno_and_return_minus_one( EINVAL ); } -- cgit v1.2.3