Changeset 12261


Ignore:
Timestamp:
Mar 30, 2011, 12:29:07 AM (11 years ago)
Author:
jch
Message:

Don't explicitly protect against non-monotonic gettimeofday.

Since we're now protecting against non-monotonic time unconditionally,
there's no need for additional protection in the gettimeofday case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/libutp/utp_utils.cpp

    r12260 r12261  
    142142#endif
    143143        {
    144                 static time_t offset = 0, previous = 0;
    145144                struct timeval tv;
    146145                rc = gettimeofday(&tv, NULL);
    147                 tv.tv_sec += offset;
    148                 if (previous > tv.tv_sec) {
    149                         offset += previous - tv.tv_sec;
    150                         tv.tv_sec = previous;
    151                 }
    152                 previous = tv.tv_sec;
    153146                return uint64(tv.tv_sec) * 1000000 + tv.tv_usec;
    154147        }
Note: See TracChangeset for help on using the changeset viewer.