VirtualBox

Ignore:
Timestamp:
Jan 11, 2010 2:45:34 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56467
Message:

iprt: Use RTMSINTERVAL for timeouts. Fixed missing timeout underflow checks in two RTFileAioCtxWait implementations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp

    r25645 r25724  
    807807
    808808
    809 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     809RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    810810                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    811811{
     
    832832        return VERR_INVALID_PARAMETER;
    833833
    834     if (cMillisTimeout != RT_INDEFINITE_WAIT)
     834    if (cMillies != RT_INDEFINITE_WAIT)
    835835    {
    836         Timeout.tv_sec  = cMillisTimeout / 1000;
    837         Timeout.tv_nsec = (cMillisTimeout % 1000) * 1000000;
     836        Timeout.tv_sec  = cMillies / 1000;
     837        Timeout.tv_nsec = (cMillies % 1000) * 1000000;
    838838        pTimeout = &Timeout;
    839839        StartNanoTS = RTTimeNanoTS();
     
    964964                break;
    965965
    966             if (cMillisTimeout != RT_INDEFINITE_WAIT)
     966            if (cMillies != RT_INDEFINITE_WAIT)
    967967            {
    968968                uint64_t TimeDiff;
     
    970970                /* Recalculate the timeout. */
    971971                TimeDiff = RTTimeSystemNanoTS() - StartNanoTS;
    972                 Timeout.tv_sec = Timeout.tv_sec - (TimeDiff / 1000000);
     972                Timeout.tv_sec  = Timeout.tv_sec - (TimeDiff / 1000000);
    973973                Timeout.tv_nsec = Timeout.tv_nsec - (TimeDiff % 1000000);
    974974            }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette