Changeset 753c05a in rtems


Ignore:
Timestamp:
Aug 19, 2008, 2:45:15 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
e77c7238
Parents:
ea0586b1
Message:

2008-08-19 Tim FitzGeorge? <tim.fitzgeorge@…>

PR 1296/cpukit.

  • posix/src/timersettime.c: POSIX timers use incorrect repeat interval. This patch fixes the following problems in timer_settime: 1) Uses value.it_interval for repeat period. 2) Corrects test for incorrect value of it_value.tv_nsec (should reject 1000000000).
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rea0586b1 r753c05a  
     12008-08-19      Tim FitzGeorge <tim.fitzgeorge@astrium.eads.net>
     2
     3        PR 1296/cpukit.
     4        * posix/src/timersettime.c: POSIX timers use incorrect repeat interval.
     5        This patch fixes the following problems in timer_settime: 1) Uses
     6        value.it_interval for repeat period. 2) Corrects test for incorrect
     7        value of it_value.tv_nsec (should reject 1000000000).
     8
    192008-08-19      Joel Sherrill <joel.sherrill@OARcorp.com>
    210
  • cpukit/posix/src/timersettime.c

    rea0586b1 r753c05a  
    3737  Objects_Locations    location;
    3838  boolean              activated;
     39  uint32_t             initial_period;
    3940  struct itimerspec    normalize;
    4041
     
    4344
    4445  /* First, it verifies if the structure "value" is correct */
    45   if ( ( value->it_value.tv_nsec > TOD_NANOSECONDS_PER_SECOND ) ||
    46        ( value->it_value.tv_nsec < 0 ) ) {
     46  if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) ||
     47       ( value->it_value.tv_nsec < 0 ) ||
     48       ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) ||
     49       ( value->it_interval.tv_nsec < 0 )) {
    4750    /* The number of nanoseconds is not correct */
    4851    rtems_set_errno_and_return_minus_one( EINVAL );
     
    5861  if (flags == TIMER_ABSTIME) {
    5962    /* Check for seconds in the past */
    60     if ( _Timespec_Greater_than( &normalize.it_value, &_TOD_Now ) )
     63    if ( _Timespec_Greater_than( &_TOD_Now, &normalize.it_value ) )
    6164      rtems_set_errno_and_return_minus_one( EINVAL );
    6265    _Timespec_Subtract( &_TOD_Now, &normalize.it_value, &normalize.it_value );
     
    8992
    9093       /* Convert from seconds and nanoseconds to ticks */
    91        ptimer->ticks = _Timespec_To_ticks( &normalize.it_value );
     94       ptimer->ticks  = _Timespec_To_ticks( &value->it_interval );
     95       initial_period = _Timespec_To_ticks( &normalize.it_value );
     96       
    9297       
    9398       activated = _POSIX_Timer_Insert_helper(
    9499         &ptimer->Timer,
    95          ptimer->ticks,
     100         initial_period,
    96101         ptimer->Object.id,
    97102         _POSIX_Timer_TSR,
Note: See TracChangeset for help on using the changeset viewer.