summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/clockgettime.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-01 00:44:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-01 00:44:15 +0000
commite889a857cd6a5d8366bcecf78d6075dfd414d252 (patch)
tree44996fa8e75d0443a40dfb94b8952ae2314a1ea3 /cpukit/posix/src/clockgettime.c
parent2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-e889a857cd6a5d8366bcecf78d6075dfd414d252.tar.bz2
2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/src/clockgettime.c, posix/src/clocksettime.c, Minor modifications to improve testability. * posix/src/pthreadcreate.c: Add NULL check for thread entry.
Diffstat (limited to 'cpukit/posix/src/clockgettime.c')
-rw-r--r--cpukit/posix/src/clockgettime.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c
index d87503e2cf..d94bd16f98 100644
--- a/cpukit/posix/src/clockgettime.c
+++ b/cpukit/posix/src/clockgettime.c
@@ -36,32 +36,22 @@ int clock_gettime(
if ( !tp )
rtems_set_errno_and_return_minus_one( EINVAL );
- switch ( clock_id ) {
-
- case CLOCK_REALTIME:
- _TOD_Get(tp);
- break;
-
+ if ( clock_id == CLOCK_REALTIME )
+ _TOD_Get(tp);
#ifdef CLOCK_MONOTONIC
- case CLOCK_MONOTONIC:
- _TOD_Get_uptime(tp);
- break;
+ else if ( clock_id == CLOCK_MONOTONIC )
+ _TOD_Get_uptime(tp);
#endif
-
#ifdef _POSIX_CPUTIME
- case CLOCK_PROCESS_CPUTIME:
- _TOD_Get_uptime(tp);
- break;
+ else if ( clock_id == CLOCK_PROCESS_CPUTIME )
+ _TOD_Get_uptime(tp);
#endif
-
#ifdef _POSIX_THREAD_CPUTIME
- case CLOCK_THREAD_CPUTIME:
- rtems_set_errno_and_return_minus_one( ENOSYS );
- break;
+ else if ( clock_id == CLOCK_THREAD_CPUTIME )
+ rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
- default:
- rtems_set_errno_and_return_minus_one( EINVAL );
+ else
+ rtems_set_errno_and_return_minus_one( EINVAL );
- }
return 0;
}