summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/getitimer.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-15 17:43:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-15 17:43:02 +0000
commit5860b90232302865678a6efe57f92ae60a5ef562 (patch)
tree98dd49bc888daa29a230b74c0d2938f87197242b /cpukit/posix/src/getitimer.c
parent2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-5860b90232302865678a6efe57f92ae60a5ef562.tar.bz2
2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/src/getitimer.c, posix/src/setitimer.c: Add error checks and clean up so coverage analysis is possible.
Diffstat (limited to 'cpukit/posix/src/getitimer.c')
-rw-r--r--cpukit/posix/src/getitimer.c17
1 files changed, 11 insertions, 6 deletions
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 );
}