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.
This commit is contained in:
Joel Sherrill
2009-05-15 17:43:02 +00:00
parent 9bced10753
commit 5860b90232
3 changed files with 29 additions and 11 deletions
+5
View File
@@ -1,3 +1,8 @@
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.
2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/src/sysconf.c: Restructure to improve coverage analysis.
+11 -6
View File
@@ -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 );
}
+13 -5
View File
@@ -24,12 +24,20 @@ int setitimer(
struct itimerval *ovalue
)
{
if ( !value )
rtems_set_errno_and_return_minus_one( EFAULT );
if ( !ovalue )
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 );
}