Ignore:
Timestamp:
Jun 12, 2009, 11:01:35 PM (13 years ago)
Author:
charles
Message:

(trunk libT) possible fix for #2078: Assertion failed: (tv->tv_usec >= 0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8592 r8681  
    458458**/
    459459
     460tr_bool
     461tr_isTimeval( const struct timeval * tv )
     462{
     463    return tv && ( tv->tv_sec >= 0 )
     464              && ( tv->tv_usec >= 0 )
     465              && ( tv->tv_usec < 1000000 );
     466}
     467
    460468void
    461469tr_timevalMsec( uint64_t milliseconds, struct timeval * setme )
     
    465473    setme->tv_sec  = microseconds / 1000000;
    466474    setme->tv_usec = microseconds % 1000000;
    467 }
     475    assert( tr_isTimeval( setme ) );
     476}
     477
     478void
     479tr_timevalSet( struct timeval * setme, int seconds, int microseconds )
     480{
     481    setme->tv_sec = seconds;
     482    setme->tv_usec = microseconds;
     483    assert( tr_isTimeval( setme ) );
     484}
     485
     486
     487/**
     488***
     489**/
    468490
    469491uint8_t *
Note: See TracChangeset for help on using the changeset viewer.