Changeset 9a5cbef0 in rtems


Ignore:
Timestamp:
Sep 5, 1996, 8:29:07 PM (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
7e230f10
Parents:
f254b93f
Message:

nanosleep: negative value for tv_sec is no longer an error. It now
is changed into being a 0 delay.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/time.c

    rf254b93f r9a5cbef0  
    246246)
    247247{
    248   Watchdog_Interval ticks;
     248  Watchdog_Interval  ticks;
     249  struct timespec   *the_rqtp;
    249250
    250251  if ( !rqtp )
    251252    set_errno_and_return_minus_one( EINVAL );
     253
     254  the_rqtp = (struct timespec *)rqtp;
    252255
    253256  /*
     
    258261   */
    259262
    260   if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
     263  if ( the_rqtp->tv_sec < 0 )
     264    the_rqtp->tv_sec = 0;
     265
     266  if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 )
    261267    set_errno_and_return_minus_one( EAGAIN );
    262268
    263   if ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
     269  if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
    264270    set_errno_and_return_minus_one( EINVAL );
    265271 
    266   ticks = _POSIX_Timespec_to_interval( rqtp );
     272  ticks = _POSIX_Timespec_to_interval( the_rqtp );
    267273
    268274  /*
  • cpukit/posix/src/time.c

    rf254b93f r9a5cbef0  
    246246)
    247247{
    248   Watchdog_Interval ticks;
     248  Watchdog_Interval  ticks;
     249  struct timespec   *the_rqtp;
    249250
    250251  if ( !rqtp )
    251252    set_errno_and_return_minus_one( EINVAL );
     253
     254  the_rqtp = (struct timespec *)rqtp;
    252255
    253256  /*
     
    258261   */
    259262
    260   if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
     263  if ( the_rqtp->tv_sec < 0 )
     264    the_rqtp->tv_sec = 0;
     265
     266  if ( /* the_rqtp->tv_sec < 0 || */ the_rqtp->tv_nsec < 0 )
    261267    set_errno_and_return_minus_one( EAGAIN );
    262268
    263   if ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
     269  if ( the_rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
    264270    set_errno_and_return_minus_one( EINVAL );
    265271 
    266   ticks = _POSIX_Timespec_to_interval( rqtp );
     272  ticks = _POSIX_Timespec_to_interval( the_rqtp );
    267273
    268274  /*
Note: See TracChangeset for help on using the changeset viewer.