Changeset e889a857 in rtems


Ignore:
Timestamp:
Feb 1, 2008, 12:44:15 AM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
016e1e2
Parents:
920343e
Message:

2008-01-31 Joel Sherrill <joel.sherrill@…>

  • posix/src/clockgettime.c, posix/src/clocksettime.c, Minor modifications to improve testability.
  • posix/src/pthreadcreate.c: Add NULL check for thread entry.
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r920343e re889a857  
     12008-01-31      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * posix/src/clockgettime.c, posix/src/clocksettime.c,
     4        Minor modifications to improve testability.
     5        * posix/src/pthreadcreate.c: Add NULL check for thread entry.
     6
    172008-01-31      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • cpukit/posix/src/clockgettime.c

    r920343e re889a857  
    3737    rtems_set_errno_and_return_minus_one( EINVAL );
    3838
    39   switch ( clock_id ) {
     39  if ( clock_id == CLOCK_REALTIME )
     40    _TOD_Get(tp);
     41#ifdef CLOCK_MONOTONIC
     42  else if ( clock_id == CLOCK_MONOTONIC )
     43    _TOD_Get_uptime(tp);
     44#endif
     45#ifdef _POSIX_CPUTIME
     46  else if ( clock_id == CLOCK_PROCESS_CPUTIME )
     47    _TOD_Get_uptime(tp);
     48#endif
     49#ifdef _POSIX_THREAD_CPUTIME
     50  else if ( clock_id == CLOCK_THREAD_CPUTIME )
     51    rtems_set_errno_and_return_minus_one( ENOSYS );
     52#endif
     53  else
     54    rtems_set_errno_and_return_minus_one( EINVAL );
    4055
    41     case CLOCK_REALTIME:
    42       _TOD_Get(tp);
    43       break;
    44 
    45 #ifdef CLOCK_MONOTONIC
    46     case CLOCK_MONOTONIC:
    47       _TOD_Get_uptime(tp);
    48       break;
    49 #endif
    50 
    51 #ifdef _POSIX_CPUTIME
    52     case CLOCK_PROCESS_CPUTIME:
    53       _TOD_Get_uptime(tp);
    54       break;
    55 #endif
    56 
    57 #ifdef _POSIX_THREAD_CPUTIME
    58     case CLOCK_THREAD_CPUTIME:
    59       rtems_set_errno_and_return_minus_one( ENOSYS );
    60       break;
    61 #endif
    62     default:
    63       rtems_set_errno_and_return_minus_one( EINVAL );
    64 
    65   }
    6656  return 0;
    6757}
  • cpukit/posix/src/clocksettime.c

    r920343e re889a857  
    3737    rtems_set_errno_and_return_minus_one( EINVAL );
    3838
    39   switch ( clock_id ) {
    40 
    41     case CLOCK_REALTIME:
    42       if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
    43         rtems_set_errno_and_return_minus_one( EINVAL );
    44 
    45       _Thread_Disable_dispatch();
    46         _TOD_Set( tp );
    47       _Thread_Enable_dispatch();
    48       break;
    49 
    50 #ifdef _POSIX_CPUTIME
    51     case CLOCK_PROCESS_CPUTIME:
    52       rtems_set_errno_and_return_minus_one( ENOSYS );
    53       break;
    54 #endif
    55 
    56 #ifdef _POSIX_THREAD_CPUTIME
    57     case CLOCK_THREAD_CPUTIME:
    58       rtems_set_errno_and_return_minus_one( ENOSYS );
    59       break;
    60 #endif
    61     default:
     39  if ( clock_id == CLOCK_REALTIME ) {
     40    if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
    6241      rtems_set_errno_and_return_minus_one( EINVAL );
    6342
     43    _Thread_Disable_dispatch();
     44      _TOD_Set( tp );
     45    _Thread_Enable_dispatch();
    6446  }
     47#ifdef _POSIX_CPUTIME
     48  else if ( clock_id == CLOCK_PROCESS_CPUTIME )
     49    rtems_set_errno_and_return_minus_one( ENOSYS );
     50#endif
     51#ifdef _POSIX_THREAD_CPUTIME
     52  else if ( clock_id == CLOCK_THREAD_CPUTIME )
     53    rtems_set_errno_and_return_minus_one( ENOSYS );
     54#endif
     55  else
     56    rtems_set_errno_and_return_minus_one( EINVAL );
     57
    6558  return 0;
    6659}
  • cpukit/posix/src/pthreadcreate.c

    r920343e re889a857  
    4545  Objects_Name                        name;
    4646
     47  if ( !start_routine )
     48    return EFAULT;
     49
    4750  the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
    4851
Note: See TracChangeset for help on using the changeset viewer.